diff --git a/.gitattributes b/.gitattributes index f1d1336935..935698a983 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,9 +21,6 @@ mobile/drift_schemas/main/drift_schema_*.json linguist-generated=true mobile/lib/infrastructure/repositories/db.repository.steps.dart -diff -merge mobile/lib/infrastructure/repositories/db.repository.steps.dart linguist-generated=true -mobile/test/drift/main/generated/** -diff -merge -mobile/test/drift/main/generated/** linguist-generated=true - packages/sdk/fetch-client.ts -diff -merge packages/sdk/fetch-client.ts linguist-generated=true diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.yml index a197facfc5..d509b404a1 100644 --- a/.github/workflows/build-mobile.yml +++ b/.github/workflows/build-mobile.yml @@ -130,12 +130,8 @@ jobs: - name: Install dependencies run: mise //mobile:install:ci - - name: Generate translation file - run: mise //mobile:codegen:translation - - - name: Generate platform APIs - run: mise //mobile:codegen:pigeon - working-directory: ./mobile + - name: Perform codegen + run: mise //mobile:codegen - name: Build Android App Bundle working-directory: ./mobile @@ -228,11 +224,8 @@ jobs: - name: Install dependencies run: mise //mobile:install:ci - - name: Generate translation files - run: mise //mobile:codegen:translation - - - name: Generate platform APIs - run: mise //mobile:codegen:pigeon + - name: Perform codegen + run: mise //mobile:codegen - name: Resolve iOS Swift Packages working-directory: ./mobile diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 2ca3ac8f71..8fe1e1265c 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -76,34 +76,8 @@ jobs: run: flutter pub get --enforce-lockfile working-directory: ./mobile/packages/ui - - name: Generate translation files - run: mise //mobile:codegen:translation - - - name: Run Build Runner - run: mise //mobile:codegen:dart - - - name: Generate platform API - run: mise //mobile:codegen:pigeon - - - name: Find file changes - uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 - id: verify-changed-files - with: - files: | - mobile/**/*.g.dart - mobile/**/*.gr.dart - mobile/**/*.drift.dart - mobile/**/*.g.swift - mobile/**/*.g.kt - - - name: Verify files have not changed - if: steps.verify-changed-files.outputs.files_changed == 'true' - env: - CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} - run: | - echo "ERROR: Generated files not up to date! Run 'mise //mobile:codegen:dart' and 'mise //mobile:codegen:pigeon'" - echo "Changed files: ${CHANGED_FILES}" - exit 1 + - name: Perform codegen + run: mise //mobile:codegen - name: Run analyze run: mise //mobile:analyze diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77a6992058..e01d28ed9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -612,8 +612,8 @@ jobs: - name: Install dependencies run: mise //mobile:install:ci - - name: Generate translation files - run: mise //mobile:codegen:translation + - name: Perform codegen + run: mise //mobile:codegen - name: Run tests run: mise //mobile:test diff --git a/mobile/.gitignore b/mobile/.gitignore index 04eb74fddd..64aa4a8dd7 100644 --- a/mobile/.gitignore +++ b/mobile/.gitignore @@ -31,6 +31,8 @@ .pub-cache/ .pub/ /build/ +lib/**/*.drift.dart +test/drift/main/generated/ # Web related lib/generated_plugin_registrant.dart diff --git a/mobile/lib/infrastructure/entities/asset_edit.entity.drift.dart b/mobile/lib/infrastructure/entities/asset_edit.entity.drift.dart deleted file mode 100644 index 32a331b28e..0000000000 --- a/mobile/lib/infrastructure/entities/asset_edit.entity.drift.dart +++ /dev/null @@ -1,743 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/asset_edit.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/asset_edit.model.dart' as i2; -import 'dart:typed_data' as i3; -import 'package:immich_mobile/infrastructure/entities/asset_edit.entity.dart' - as i4; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i5; -import 'package:drift/internal/modular.dart' as i6; - -typedef $$AssetEditEntityTableCreateCompanionBuilder = - i1.AssetEditEntityCompanion Function({ - required String id, - required String assetId, - required i2.AssetEditAction action, - required Map parameters, - required int sequence, - }); -typedef $$AssetEditEntityTableUpdateCompanionBuilder = - i1.AssetEditEntityCompanion Function({ - i0.Value id, - i0.Value assetId, - i0.Value action, - i0.Value> parameters, - i0.Value sequence, - }); - -final class $$AssetEditEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$AssetEditEntityTable, - i1.AssetEditEntityData - > { - $$AssetEditEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i5.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i6.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias('asset_edit_entity__asset_id__remote_asset_entity__id'); - - i5.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i5 - .$$RemoteAssetEntityTableTableManager( - $_db, - i6.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$AssetEditEntityTableFilterComposer - extends i0.Composer { - $$AssetEditEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get action => $composableBuilder( - column: $table.action, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnWithTypeConverterFilters< - Map, - Map, - i3.Uint8List - > - get parameters => $composableBuilder( - column: $table.parameters, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get sequence => $composableBuilder( - column: $table.sequence, - builder: (column) => i0.ColumnFilters(column), - ); - - i5.$$RemoteAssetEntityTableFilterComposer get assetId { - final i5.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetEditEntityTableOrderingComposer - extends i0.Composer { - $$AssetEditEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get action => $composableBuilder( - column: $table.action, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get parameters => $composableBuilder( - column: $table.parameters, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get sequence => $composableBuilder( - column: $table.sequence, - builder: (column) => i0.ColumnOrderings(column), - ); - - i5.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i5.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetEditEntityTableAnnotationComposer - extends i0.Composer { - $$AssetEditEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter get action => - $composableBuilder(column: $table.action, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter, i3.Uint8List> - get parameters => $composableBuilder( - column: $table.parameters, - builder: (column) => column, - ); - - i0.GeneratedColumn get sequence => - $composableBuilder(column: $table.sequence, builder: (column) => column); - - i5.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i5.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetEditEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$AssetEditEntityTable, - i1.AssetEditEntityData, - i1.$$AssetEditEntityTableFilterComposer, - i1.$$AssetEditEntityTableOrderingComposer, - i1.$$AssetEditEntityTableAnnotationComposer, - $$AssetEditEntityTableCreateCompanionBuilder, - $$AssetEditEntityTableUpdateCompanionBuilder, - (i1.AssetEditEntityData, i1.$$AssetEditEntityTableReferences), - i1.AssetEditEntityData, - i0.PrefetchHooks Function({bool assetId}) - > { - $$AssetEditEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$AssetEditEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$AssetEditEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$AssetEditEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => i1 - .$$AssetEditEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value assetId = const i0.Value.absent(), - i0.Value action = const i0.Value.absent(), - i0.Value> parameters = - const i0.Value.absent(), - i0.Value sequence = const i0.Value.absent(), - }) => i1.AssetEditEntityCompanion( - id: id, - assetId: assetId, - action: action, - parameters: parameters, - sequence: sequence, - ), - createCompanionCallback: - ({ - required String id, - required String assetId, - required i2.AssetEditAction action, - required Map parameters, - required int sequence, - }) => i1.AssetEditEntityCompanion.insert( - id: id, - assetId: assetId, - action: action, - parameters: parameters, - sequence: sequence, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$AssetEditEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$AssetEditEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$AssetEditEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$AssetEditEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$AssetEditEntityTable, - i1.AssetEditEntityData, - i1.$$AssetEditEntityTableFilterComposer, - i1.$$AssetEditEntityTableOrderingComposer, - i1.$$AssetEditEntityTableAnnotationComposer, - $$AssetEditEntityTableCreateCompanionBuilder, - $$AssetEditEntityTableUpdateCompanionBuilder, - (i1.AssetEditEntityData, i1.$$AssetEditEntityTableReferences), - i1.AssetEditEntityData, - i0.PrefetchHooks Function({bool assetId}) - >; -i0.Index get idxAssetEditAssetId => i0.Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', -); - -class $AssetEditEntityTable extends i4.AssetEditEntity - with i0.TableInfo<$AssetEditEntityTable, i1.AssetEditEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $AssetEditEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - @override - late final i0.GeneratedColumnWithTypeConverter - action = - i0.GeneratedColumn( - 'action', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$AssetEditEntityTable.$converteraction, - ); - @override - late final i0.GeneratedColumnWithTypeConverter< - Map, - i3.Uint8List - > - parameters = - i0.GeneratedColumn( - 'parameters', - aliasedName, - false, - type: i0.DriftSqlType.blob, - requiredDuringInsert: true, - ).withConverter>( - i1.$AssetEditEntityTable.$converterparameters, - ); - static const i0.VerificationMeta _sequenceMeta = const i0.VerificationMeta( - 'sequence', - ); - @override - late final i0.GeneratedColumn sequence = i0.GeneratedColumn( - 'sequence', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('sequence')) { - context.handle( - _sequenceMeta, - sequence.isAcceptableOrUnknown(data['sequence']!, _sequenceMeta), - ); - } else if (isInserting) { - context.missing(_sequenceMeta); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: i1.$AssetEditEntityTable.$converteraction.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - ), - parameters: i1.$AssetEditEntityTable.$converterparameters.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - ), - sequence: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - $AssetEditEntityTable createAlias(String alias) { - return $AssetEditEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converteraction = - const i0.EnumIndexConverter( - i2.AssetEditAction.values, - ); - static i0.JsonTypeConverter2, i3.Uint8List, Object?> - $converterparameters = i4.editParameterConverter; - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetEditEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String assetId; - final i2.AssetEditAction action; - final Map parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['asset_id'] = i0.Variable(assetId); - { - map['action'] = i0.Variable( - i1.$AssetEditEntityTable.$converteraction.toSql(action), - ); - } - { - map['parameters'] = i0.Variable( - i1.$AssetEditEntityTable.$converterparameters.toSql(parameters), - ); - } - map['sequence'] = i0.Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: i1.$AssetEditEntityTable.$converteraction.fromJson( - serializer.fromJson(json['action']), - ), - parameters: i1.$AssetEditEntityTable.$converterparameters.fromJson( - serializer.fromJson(json['parameters']), - ), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson( - i1.$AssetEditEntityTable.$converteraction.toJson(action), - ), - 'parameters': serializer.toJson( - i1.$AssetEditEntityTable.$converterparameters.toJson(parameters), - ), - 'sequence': serializer.toJson(sequence), - }; - } - - i1.AssetEditEntityData copyWith({ - String? id, - String? assetId, - i2.AssetEditAction? action, - Map? parameters, - int? sequence, - }) => i1.AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(i1.AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, assetId, action, parameters, sequence); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - other.parameters == this.parameters && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value assetId; - final i0.Value action; - final i0.Value> parameters; - final i0.Value sequence; - const AssetEditEntityCompanion({ - this.id = const i0.Value.absent(), - this.assetId = const i0.Value.absent(), - this.action = const i0.Value.absent(), - this.parameters = const i0.Value.absent(), - this.sequence = const i0.Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required i2.AssetEditAction action, - required Map parameters, - required int sequence, - }) : id = i0.Value(id), - assetId = i0.Value(assetId), - action = i0.Value(action), - parameters = i0.Value(parameters), - sequence = i0.Value(sequence); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? assetId, - i0.Expression? action, - i0.Expression? parameters, - i0.Expression? sequence, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - i1.AssetEditEntityCompanion copyWith({ - i0.Value? id, - i0.Value? assetId, - i0.Value? action, - i0.Value>? parameters, - i0.Value? sequence, - }) { - return i1.AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (action.present) { - map['action'] = i0.Variable( - i1.$AssetEditEntityTable.$converteraction.toSql(action.value), - ); - } - if (parameters.present) { - map['parameters'] = i0.Variable( - i1.$AssetEditEntityTable.$converterparameters.toSql(parameters.value), - ); - } - if (sequence.present) { - map['sequence'] = i0.Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/asset_face.entity.drift.dart b/mobile/lib/infrastructure/entities/asset_face.entity.drift.dart deleted file mode 100644 index 161e3ca05e..0000000000 --- a/mobile/lib/infrastructure/entities/asset_face.entity.drift.dart +++ /dev/null @@ -1,1338 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/asset_face.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/asset_face.entity.dart' - as i2; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i4; -import 'package:drift/internal/modular.dart' as i5; -import 'package:immich_mobile/infrastructure/entities/person.entity.drift.dart' - as i6; - -typedef $$AssetFaceEntityTableCreateCompanionBuilder = - i1.AssetFaceEntityCompanion Function({ - required String id, - required String assetId, - i0.Value personId, - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - i0.Value isVisible, - i0.Value deletedAt, - }); -typedef $$AssetFaceEntityTableUpdateCompanionBuilder = - i1.AssetFaceEntityCompanion Function({ - i0.Value id, - i0.Value assetId, - i0.Value personId, - i0.Value imageWidth, - i0.Value imageHeight, - i0.Value boundingBoxX1, - i0.Value boundingBoxY1, - i0.Value boundingBoxX2, - i0.Value boundingBoxY2, - i0.Value sourceType, - i0.Value isVisible, - i0.Value deletedAt, - }); - -final class $$AssetFaceEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$AssetFaceEntityTable, - i1.AssetFaceEntityData - > { - $$AssetFaceEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i4.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias('asset_face_entity__asset_id__remote_asset_entity__id'); - - i4.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i4 - .$$RemoteAssetEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static i6.$PersonEntityTable _personIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('person_entity') - .createAlias('asset_face_entity__person_id__person_entity__id'); - - i6.$$PersonEntityTableProcessedTableManager? get personId { - final $_column = $_itemColumn('person_id'); - if ($_column == null) return null; - final manager = i6 - .$$PersonEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('person_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_personIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$AssetFaceEntityTableFilterComposer - extends i0.Composer { - $$AssetFaceEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get imageWidth => $composableBuilder( - column: $table.imageWidth, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get imageHeight => $composableBuilder( - column: $table.imageHeight, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get boundingBoxX1 => $composableBuilder( - column: $table.boundingBoxX1, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get boundingBoxY1 => $composableBuilder( - column: $table.boundingBoxY1, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get boundingBoxX2 => $composableBuilder( - column: $table.boundingBoxX2, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get boundingBoxY2 => $composableBuilder( - column: $table.boundingBoxY2, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get sourceType => $composableBuilder( - column: $table.sourceType, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isVisible => $composableBuilder( - column: $table.isVisible, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get deletedAt => $composableBuilder( - column: $table.deletedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i4.$$RemoteAssetEntityTableFilterComposer get assetId { - final i4.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i6.$$PersonEntityTableFilterComposer get personId { - final i6.$$PersonEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.personId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('person_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i6.$$PersonEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('person_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetFaceEntityTableOrderingComposer - extends i0.Composer { - $$AssetFaceEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get imageWidth => $composableBuilder( - column: $table.imageWidth, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get imageHeight => $composableBuilder( - column: $table.imageHeight, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get boundingBoxX1 => $composableBuilder( - column: $table.boundingBoxX1, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get boundingBoxY1 => $composableBuilder( - column: $table.boundingBoxY1, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get boundingBoxX2 => $composableBuilder( - column: $table.boundingBoxX2, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get boundingBoxY2 => $composableBuilder( - column: $table.boundingBoxY2, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get sourceType => $composableBuilder( - column: $table.sourceType, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isVisible => $composableBuilder( - column: $table.isVisible, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get deletedAt => $composableBuilder( - column: $table.deletedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i4.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i4.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i6.$$PersonEntityTableOrderingComposer get personId { - final i6.$$PersonEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.personId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('person_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i6.$$PersonEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('person_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetFaceEntityTableAnnotationComposer - extends i0.Composer { - $$AssetFaceEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get imageWidth => $composableBuilder( - column: $table.imageWidth, - builder: (column) => column, - ); - - i0.GeneratedColumn get imageHeight => $composableBuilder( - column: $table.imageHeight, - builder: (column) => column, - ); - - i0.GeneratedColumn get boundingBoxX1 => $composableBuilder( - column: $table.boundingBoxX1, - builder: (column) => column, - ); - - i0.GeneratedColumn get boundingBoxY1 => $composableBuilder( - column: $table.boundingBoxY1, - builder: (column) => column, - ); - - i0.GeneratedColumn get boundingBoxX2 => $composableBuilder( - column: $table.boundingBoxX2, - builder: (column) => column, - ); - - i0.GeneratedColumn get boundingBoxY2 => $composableBuilder( - column: $table.boundingBoxY2, - builder: (column) => column, - ); - - i0.GeneratedColumn get sourceType => $composableBuilder( - column: $table.sourceType, - builder: (column) => column, - ); - - i0.GeneratedColumn get isVisible => - $composableBuilder(column: $table.isVisible, builder: (column) => column); - - i0.GeneratedColumn get deletedAt => - $composableBuilder(column: $table.deletedAt, builder: (column) => column); - - i4.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i4.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i6.$$PersonEntityTableAnnotationComposer get personId { - final i6.$$PersonEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.personId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('person_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i6.$$PersonEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('person_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetFaceEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$AssetFaceEntityTable, - i1.AssetFaceEntityData, - i1.$$AssetFaceEntityTableFilterComposer, - i1.$$AssetFaceEntityTableOrderingComposer, - i1.$$AssetFaceEntityTableAnnotationComposer, - $$AssetFaceEntityTableCreateCompanionBuilder, - $$AssetFaceEntityTableUpdateCompanionBuilder, - (i1.AssetFaceEntityData, i1.$$AssetFaceEntityTableReferences), - i1.AssetFaceEntityData, - i0.PrefetchHooks Function({bool assetId, bool personId}) - > { - $$AssetFaceEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$AssetFaceEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$AssetFaceEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$AssetFaceEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => i1 - .$$AssetFaceEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value assetId = const i0.Value.absent(), - i0.Value personId = const i0.Value.absent(), - i0.Value imageWidth = const i0.Value.absent(), - i0.Value imageHeight = const i0.Value.absent(), - i0.Value boundingBoxX1 = const i0.Value.absent(), - i0.Value boundingBoxY1 = const i0.Value.absent(), - i0.Value boundingBoxX2 = const i0.Value.absent(), - i0.Value boundingBoxY2 = const i0.Value.absent(), - i0.Value sourceType = const i0.Value.absent(), - i0.Value isVisible = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - }) => i1.AssetFaceEntityCompanion( - id: id, - assetId: assetId, - personId: personId, - imageWidth: imageWidth, - imageHeight: imageHeight, - boundingBoxX1: boundingBoxX1, - boundingBoxY1: boundingBoxY1, - boundingBoxX2: boundingBoxX2, - boundingBoxY2: boundingBoxY2, - sourceType: sourceType, - isVisible: isVisible, - deletedAt: deletedAt, - ), - createCompanionCallback: - ({ - required String id, - required String assetId, - i0.Value personId = const i0.Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - i0.Value isVisible = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - }) => i1.AssetFaceEntityCompanion.insert( - id: id, - assetId: assetId, - personId: personId, - imageWidth: imageWidth, - imageHeight: imageHeight, - boundingBoxX1: boundingBoxX1, - boundingBoxY1: boundingBoxY1, - boundingBoxX2: boundingBoxX2, - boundingBoxY2: boundingBoxY2, - sourceType: sourceType, - isVisible: isVisible, - deletedAt: deletedAt, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$AssetFaceEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false, personId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$AssetFaceEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$AssetFaceEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - if (personId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.personId, - referencedTable: i1 - .$$AssetFaceEntityTableReferences - ._personIdTable(db), - referencedColumn: i1 - .$$AssetFaceEntityTableReferences - ._personIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$AssetFaceEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$AssetFaceEntityTable, - i1.AssetFaceEntityData, - i1.$$AssetFaceEntityTableFilterComposer, - i1.$$AssetFaceEntityTableOrderingComposer, - i1.$$AssetFaceEntityTableAnnotationComposer, - $$AssetFaceEntityTableCreateCompanionBuilder, - $$AssetFaceEntityTableUpdateCompanionBuilder, - (i1.AssetFaceEntityData, i1.$$AssetFaceEntityTableReferences), - i1.AssetFaceEntityData, - i0.PrefetchHooks Function({bool assetId, bool personId}) - >; -i0.Index get idxAssetFacePersonId => i0.Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', -); - -class $AssetFaceEntityTable extends i2.AssetFaceEntity - with i0.TableInfo<$AssetFaceEntityTable, i1.AssetFaceEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $AssetFaceEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _personIdMeta = const i0.VerificationMeta( - 'personId', - ); - @override - late final i0.GeneratedColumn personId = i0.GeneratedColumn( - 'person_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - static const i0.VerificationMeta _imageWidthMeta = const i0.VerificationMeta( - 'imageWidth', - ); - @override - late final i0.GeneratedColumn imageWidth = i0.GeneratedColumn( - 'image_width', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _imageHeightMeta = const i0.VerificationMeta( - 'imageHeight', - ); - @override - late final i0.GeneratedColumn imageHeight = i0.GeneratedColumn( - 'image_height', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _boundingBoxX1Meta = - const i0.VerificationMeta('boundingBoxX1'); - @override - late final i0.GeneratedColumn boundingBoxX1 = i0.GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _boundingBoxY1Meta = - const i0.VerificationMeta('boundingBoxY1'); - @override - late final i0.GeneratedColumn boundingBoxY1 = i0.GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _boundingBoxX2Meta = - const i0.VerificationMeta('boundingBoxX2'); - @override - late final i0.GeneratedColumn boundingBoxX2 = i0.GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _boundingBoxY2Meta = - const i0.VerificationMeta('boundingBoxY2'); - @override - late final i0.GeneratedColumn boundingBoxY2 = i0.GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _sourceTypeMeta = const i0.VerificationMeta( - 'sourceType', - ); - @override - late final i0.GeneratedColumn sourceType = i0.GeneratedColumn( - 'source_type', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _isVisibleMeta = const i0.VerificationMeta( - 'isVisible', - ); - @override - late final i0.GeneratedColumn isVisible = i0.GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_visible" IN (0, 1))', - ), - defaultValue: const i3.Constant(true), - ); - static const i0.VerificationMeta _deletedAtMeta = const i0.VerificationMeta( - 'deletedAt', - ); - @override - late final i0.GeneratedColumn deletedAt = - i0.GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('person_id')) { - context.handle( - _personIdMeta, - personId.isAcceptableOrUnknown(data['person_id']!, _personIdMeta), - ); - } - if (data.containsKey('image_width')) { - context.handle( - _imageWidthMeta, - imageWidth.isAcceptableOrUnknown(data['image_width']!, _imageWidthMeta), - ); - } else if (isInserting) { - context.missing(_imageWidthMeta); - } - if (data.containsKey('image_height')) { - context.handle( - _imageHeightMeta, - imageHeight.isAcceptableOrUnknown( - data['image_height']!, - _imageHeightMeta, - ), - ); - } else if (isInserting) { - context.missing(_imageHeightMeta); - } - if (data.containsKey('bounding_box_x1')) { - context.handle( - _boundingBoxX1Meta, - boundingBoxX1.isAcceptableOrUnknown( - data['bounding_box_x1']!, - _boundingBoxX1Meta, - ), - ); - } else if (isInserting) { - context.missing(_boundingBoxX1Meta); - } - if (data.containsKey('bounding_box_y1')) { - context.handle( - _boundingBoxY1Meta, - boundingBoxY1.isAcceptableOrUnknown( - data['bounding_box_y1']!, - _boundingBoxY1Meta, - ), - ); - } else if (isInserting) { - context.missing(_boundingBoxY1Meta); - } - if (data.containsKey('bounding_box_x2')) { - context.handle( - _boundingBoxX2Meta, - boundingBoxX2.isAcceptableOrUnknown( - data['bounding_box_x2']!, - _boundingBoxX2Meta, - ), - ); - } else if (isInserting) { - context.missing(_boundingBoxX2Meta); - } - if (data.containsKey('bounding_box_y2')) { - context.handle( - _boundingBoxY2Meta, - boundingBoxY2.isAcceptableOrUnknown( - data['bounding_box_y2']!, - _boundingBoxY2Meta, - ), - ); - } else if (isInserting) { - context.missing(_boundingBoxY2Meta); - } - if (data.containsKey('source_type')) { - context.handle( - _sourceTypeMeta, - sourceType.isAcceptableOrUnknown(data['source_type']!, _sourceTypeMeta), - ); - } else if (isInserting) { - context.missing(_sourceTypeMeta); - } - if (data.containsKey('is_visible')) { - context.handle( - _isVisibleMeta, - isVisible.isAcceptableOrUnknown(data['is_visible']!, _isVisibleMeta), - ); - } - if (data.containsKey('deleted_at')) { - context.handle( - _deletedAtMeta, - deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - $AssetFaceEntityTable createAlias(String alias) { - return $AssetFaceEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final bool isVisible; - final DateTime? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['asset_id'] = i0.Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = i0.Variable(personId); - } - map['image_width'] = i0.Variable(imageWidth); - map['image_height'] = i0.Variable(imageHeight); - map['bounding_box_x1'] = i0.Variable(boundingBoxX1); - map['bounding_box_y1'] = i0.Variable(boundingBoxY1); - map['bounding_box_x2'] = i0.Variable(boundingBoxX2); - map['bounding_box_y2'] = i0.Variable(boundingBoxY2); - map['source_type'] = i0.Variable(sourceType); - map['is_visible'] = i0.Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = i0.Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - i1.AssetFaceEntityData copyWith({ - String? id, - String? assetId, - i0.Value personId = const i0.Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - bool? isVisible, - i0.Value deletedAt = const i0.Value.absent(), - }) => i1.AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(i1.AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value assetId; - final i0.Value personId; - final i0.Value imageWidth; - final i0.Value imageHeight; - final i0.Value boundingBoxX1; - final i0.Value boundingBoxY1; - final i0.Value boundingBoxX2; - final i0.Value boundingBoxY2; - final i0.Value sourceType; - final i0.Value isVisible; - final i0.Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const i0.Value.absent(), - this.assetId = const i0.Value.absent(), - this.personId = const i0.Value.absent(), - this.imageWidth = const i0.Value.absent(), - this.imageHeight = const i0.Value.absent(), - this.boundingBoxX1 = const i0.Value.absent(), - this.boundingBoxY1 = const i0.Value.absent(), - this.boundingBoxX2 = const i0.Value.absent(), - this.boundingBoxY2 = const i0.Value.absent(), - this.sourceType = const i0.Value.absent(), - this.isVisible = const i0.Value.absent(), - this.deletedAt = const i0.Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const i0.Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const i0.Value.absent(), - this.deletedAt = const i0.Value.absent(), - }) : id = i0.Value(id), - assetId = i0.Value(assetId), - imageWidth = i0.Value(imageWidth), - imageHeight = i0.Value(imageHeight), - boundingBoxX1 = i0.Value(boundingBoxX1), - boundingBoxY1 = i0.Value(boundingBoxY1), - boundingBoxX2 = i0.Value(boundingBoxX2), - boundingBoxY2 = i0.Value(boundingBoxY2), - sourceType = i0.Value(sourceType); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? assetId, - i0.Expression? personId, - i0.Expression? imageWidth, - i0.Expression? imageHeight, - i0.Expression? boundingBoxX1, - i0.Expression? boundingBoxY1, - i0.Expression? boundingBoxX2, - i0.Expression? boundingBoxY2, - i0.Expression? sourceType, - i0.Expression? isVisible, - i0.Expression? deletedAt, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - i1.AssetFaceEntityCompanion copyWith({ - i0.Value? id, - i0.Value? assetId, - i0.Value? personId, - i0.Value? imageWidth, - i0.Value? imageHeight, - i0.Value? boundingBoxX1, - i0.Value? boundingBoxY1, - i0.Value? boundingBoxX2, - i0.Value? boundingBoxY2, - i0.Value? sourceType, - i0.Value? isVisible, - i0.Value? deletedAt, - }) { - return i1.AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = i0.Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = i0.Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = i0.Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = i0.Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = i0.Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = i0.Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = i0.Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = i0.Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = i0.Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = i0.Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -i0.Index get idxAssetFaceAssetId => i0.Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', -); -i0.Index get idxAssetFaceVisiblePerson => i0.Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', -); diff --git a/mobile/lib/infrastructure/entities/asset_ocr.entity.drift.dart b/mobile/lib/infrastructure/entities/asset_ocr.entity.drift.dart deleted file mode 100644 index 21f743296f..0000000000 --- a/mobile/lib/infrastructure/entities/asset_ocr.entity.drift.dart +++ /dev/null @@ -1,1279 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/asset_ocr.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/asset_ocr.entity.dart' - as i2; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i4; -import 'package:drift/internal/modular.dart' as i5; - -typedef $$AssetOcrEntityTableCreateCompanionBuilder = - i1.AssetOcrEntityCompanion Function({ - required String id, - required String assetId, - required double x1, - required double y1, - required double x2, - required double y2, - required double x3, - required double y3, - required double x4, - required double y4, - required double boxScore, - required double textScore, - required String recognizedText, - i0.Value isVisible, - }); -typedef $$AssetOcrEntityTableUpdateCompanionBuilder = - i1.AssetOcrEntityCompanion Function({ - i0.Value id, - i0.Value assetId, - i0.Value x1, - i0.Value y1, - i0.Value x2, - i0.Value y2, - i0.Value x3, - i0.Value y3, - i0.Value x4, - i0.Value y4, - i0.Value boxScore, - i0.Value textScore, - i0.Value recognizedText, - i0.Value isVisible, - }); - -final class $$AssetOcrEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$AssetOcrEntityTable, - i1.AssetOcrEntityData - > { - $$AssetOcrEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i4.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias('asset_ocr_entity__asset_id__remote_asset_entity__id'); - - i4.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i4 - .$$RemoteAssetEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$AssetOcrEntityTableFilterComposer - extends i0.Composer { - $$AssetOcrEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get x1 => $composableBuilder( - column: $table.x1, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get y1 => $composableBuilder( - column: $table.y1, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get x2 => $composableBuilder( - column: $table.x2, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get y2 => $composableBuilder( - column: $table.y2, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get x3 => $composableBuilder( - column: $table.x3, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get y3 => $composableBuilder( - column: $table.y3, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get x4 => $composableBuilder( - column: $table.x4, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get y4 => $composableBuilder( - column: $table.y4, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get boxScore => $composableBuilder( - column: $table.boxScore, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get textScore => $composableBuilder( - column: $table.textScore, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get recognizedText => $composableBuilder( - column: $table.recognizedText, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isVisible => $composableBuilder( - column: $table.isVisible, - builder: (column) => i0.ColumnFilters(column), - ); - - i4.$$RemoteAssetEntityTableFilterComposer get assetId { - final i4.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetOcrEntityTableOrderingComposer - extends i0.Composer { - $$AssetOcrEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get x1 => $composableBuilder( - column: $table.x1, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get y1 => $composableBuilder( - column: $table.y1, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get x2 => $composableBuilder( - column: $table.x2, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get y2 => $composableBuilder( - column: $table.y2, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get x3 => $composableBuilder( - column: $table.x3, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get y3 => $composableBuilder( - column: $table.y3, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get x4 => $composableBuilder( - column: $table.x4, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get y4 => $composableBuilder( - column: $table.y4, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get boxScore => $composableBuilder( - column: $table.boxScore, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get textScore => $composableBuilder( - column: $table.textScore, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get recognizedText => $composableBuilder( - column: $table.recognizedText, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isVisible => $composableBuilder( - column: $table.isVisible, - builder: (column) => i0.ColumnOrderings(column), - ); - - i4.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i4.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetOcrEntityTableAnnotationComposer - extends i0.Composer { - $$AssetOcrEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get x1 => - $composableBuilder(column: $table.x1, builder: (column) => column); - - i0.GeneratedColumn get y1 => - $composableBuilder(column: $table.y1, builder: (column) => column); - - i0.GeneratedColumn get x2 => - $composableBuilder(column: $table.x2, builder: (column) => column); - - i0.GeneratedColumn get y2 => - $composableBuilder(column: $table.y2, builder: (column) => column); - - i0.GeneratedColumn get x3 => - $composableBuilder(column: $table.x3, builder: (column) => column); - - i0.GeneratedColumn get y3 => - $composableBuilder(column: $table.y3, builder: (column) => column); - - i0.GeneratedColumn get x4 => - $composableBuilder(column: $table.x4, builder: (column) => column); - - i0.GeneratedColumn get y4 => - $composableBuilder(column: $table.y4, builder: (column) => column); - - i0.GeneratedColumn get boxScore => - $composableBuilder(column: $table.boxScore, builder: (column) => column); - - i0.GeneratedColumn get textScore => - $composableBuilder(column: $table.textScore, builder: (column) => column); - - i0.GeneratedColumn get recognizedText => $composableBuilder( - column: $table.recognizedText, - builder: (column) => column, - ); - - i0.GeneratedColumn get isVisible => - $composableBuilder(column: $table.isVisible, builder: (column) => column); - - i4.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i4.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AssetOcrEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$AssetOcrEntityTable, - i1.AssetOcrEntityData, - i1.$$AssetOcrEntityTableFilterComposer, - i1.$$AssetOcrEntityTableOrderingComposer, - i1.$$AssetOcrEntityTableAnnotationComposer, - $$AssetOcrEntityTableCreateCompanionBuilder, - $$AssetOcrEntityTableUpdateCompanionBuilder, - (i1.AssetOcrEntityData, i1.$$AssetOcrEntityTableReferences), - i1.AssetOcrEntityData, - i0.PrefetchHooks Function({bool assetId}) - > { - $$AssetOcrEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$AssetOcrEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$AssetOcrEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$AssetOcrEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => i1 - .$$AssetOcrEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value assetId = const i0.Value.absent(), - i0.Value x1 = const i0.Value.absent(), - i0.Value y1 = const i0.Value.absent(), - i0.Value x2 = const i0.Value.absent(), - i0.Value y2 = const i0.Value.absent(), - i0.Value x3 = const i0.Value.absent(), - i0.Value y3 = const i0.Value.absent(), - i0.Value x4 = const i0.Value.absent(), - i0.Value y4 = const i0.Value.absent(), - i0.Value boxScore = const i0.Value.absent(), - i0.Value textScore = const i0.Value.absent(), - i0.Value recognizedText = const i0.Value.absent(), - i0.Value isVisible = const i0.Value.absent(), - }) => i1.AssetOcrEntityCompanion( - id: id, - assetId: assetId, - x1: x1, - y1: y1, - x2: x2, - y2: y2, - x3: x3, - y3: y3, - x4: x4, - y4: y4, - boxScore: boxScore, - textScore: textScore, - recognizedText: recognizedText, - isVisible: isVisible, - ), - createCompanionCallback: - ({ - required String id, - required String assetId, - required double x1, - required double y1, - required double x2, - required double y2, - required double x3, - required double y3, - required double x4, - required double y4, - required double boxScore, - required double textScore, - required String recognizedText, - i0.Value isVisible = const i0.Value.absent(), - }) => i1.AssetOcrEntityCompanion.insert( - id: id, - assetId: assetId, - x1: x1, - y1: y1, - x2: x2, - y2: y2, - x3: x3, - y3: y3, - x4: x4, - y4: y4, - boxScore: boxScore, - textScore: textScore, - recognizedText: recognizedText, - isVisible: isVisible, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$AssetOcrEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$AssetOcrEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$AssetOcrEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$AssetOcrEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$AssetOcrEntityTable, - i1.AssetOcrEntityData, - i1.$$AssetOcrEntityTableFilterComposer, - i1.$$AssetOcrEntityTableOrderingComposer, - i1.$$AssetOcrEntityTableAnnotationComposer, - $$AssetOcrEntityTableCreateCompanionBuilder, - $$AssetOcrEntityTableUpdateCompanionBuilder, - (i1.AssetOcrEntityData, i1.$$AssetOcrEntityTableReferences), - i1.AssetOcrEntityData, - i0.PrefetchHooks Function({bool assetId}) - >; -i0.Index get idxAssetOcrAssetId => i0.Index( - 'idx_asset_ocr_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_ocr_asset_id ON asset_ocr_entity (asset_id)', -); - -class $AssetOcrEntityTable extends i2.AssetOcrEntity - with i0.TableInfo<$AssetOcrEntityTable, i1.AssetOcrEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $AssetOcrEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _x1Meta = const i0.VerificationMeta('x1'); - @override - late final i0.GeneratedColumn x1 = i0.GeneratedColumn( - 'x1', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _y1Meta = const i0.VerificationMeta('y1'); - @override - late final i0.GeneratedColumn y1 = i0.GeneratedColumn( - 'y1', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _x2Meta = const i0.VerificationMeta('x2'); - @override - late final i0.GeneratedColumn x2 = i0.GeneratedColumn( - 'x2', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _y2Meta = const i0.VerificationMeta('y2'); - @override - late final i0.GeneratedColumn y2 = i0.GeneratedColumn( - 'y2', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _x3Meta = const i0.VerificationMeta('x3'); - @override - late final i0.GeneratedColumn x3 = i0.GeneratedColumn( - 'x3', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _y3Meta = const i0.VerificationMeta('y3'); - @override - late final i0.GeneratedColumn y3 = i0.GeneratedColumn( - 'y3', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _x4Meta = const i0.VerificationMeta('x4'); - @override - late final i0.GeneratedColumn x4 = i0.GeneratedColumn( - 'x4', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _y4Meta = const i0.VerificationMeta('y4'); - @override - late final i0.GeneratedColumn y4 = i0.GeneratedColumn( - 'y4', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _boxScoreMeta = const i0.VerificationMeta( - 'boxScore', - ); - @override - late final i0.GeneratedColumn boxScore = i0.GeneratedColumn( - 'box_score', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _textScoreMeta = const i0.VerificationMeta( - 'textScore', - ); - @override - late final i0.GeneratedColumn textScore = i0.GeneratedColumn( - 'text_score', - aliasedName, - false, - type: i0.DriftSqlType.double, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _recognizedTextMeta = - const i0.VerificationMeta('recognizedText'); - @override - late final i0.GeneratedColumn recognizedText = - i0.GeneratedColumn( - 'recognized_text', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _isVisibleMeta = const i0.VerificationMeta( - 'isVisible', - ); - @override - late final i0.GeneratedColumn isVisible = i0.GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_visible" IN (0, 1))', - ), - defaultValue: const i3.Constant(true), - ); - @override - List get $columns => [ - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_ocr_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('x1')) { - context.handle(_x1Meta, x1.isAcceptableOrUnknown(data['x1']!, _x1Meta)); - } else if (isInserting) { - context.missing(_x1Meta); - } - if (data.containsKey('y1')) { - context.handle(_y1Meta, y1.isAcceptableOrUnknown(data['y1']!, _y1Meta)); - } else if (isInserting) { - context.missing(_y1Meta); - } - if (data.containsKey('x2')) { - context.handle(_x2Meta, x2.isAcceptableOrUnknown(data['x2']!, _x2Meta)); - } else if (isInserting) { - context.missing(_x2Meta); - } - if (data.containsKey('y2')) { - context.handle(_y2Meta, y2.isAcceptableOrUnknown(data['y2']!, _y2Meta)); - } else if (isInserting) { - context.missing(_y2Meta); - } - if (data.containsKey('x3')) { - context.handle(_x3Meta, x3.isAcceptableOrUnknown(data['x3']!, _x3Meta)); - } else if (isInserting) { - context.missing(_x3Meta); - } - if (data.containsKey('y3')) { - context.handle(_y3Meta, y3.isAcceptableOrUnknown(data['y3']!, _y3Meta)); - } else if (isInserting) { - context.missing(_y3Meta); - } - if (data.containsKey('x4')) { - context.handle(_x4Meta, x4.isAcceptableOrUnknown(data['x4']!, _x4Meta)); - } else if (isInserting) { - context.missing(_x4Meta); - } - if (data.containsKey('y4')) { - context.handle(_y4Meta, y4.isAcceptableOrUnknown(data['y4']!, _y4Meta)); - } else if (isInserting) { - context.missing(_y4Meta); - } - if (data.containsKey('box_score')) { - context.handle( - _boxScoreMeta, - boxScore.isAcceptableOrUnknown(data['box_score']!, _boxScoreMeta), - ); - } else if (isInserting) { - context.missing(_boxScoreMeta); - } - if (data.containsKey('text_score')) { - context.handle( - _textScoreMeta, - textScore.isAcceptableOrUnknown(data['text_score']!, _textScoreMeta), - ); - } else if (isInserting) { - context.missing(_textScoreMeta); - } - if (data.containsKey('recognized_text')) { - context.handle( - _recognizedTextMeta, - recognizedText.isAcceptableOrUnknown( - data['recognized_text']!, - _recognizedTextMeta, - ), - ); - } else if (isInserting) { - context.missing(_recognizedTextMeta); - } - if (data.containsKey('is_visible')) { - context.handle( - _isVisibleMeta, - isVisible.isAcceptableOrUnknown(data['is_visible']!, _isVisibleMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.AssetOcrEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.AssetOcrEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - x1: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}x1'], - )!, - y1: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}y1'], - )!, - x2: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}x2'], - )!, - y2: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}y2'], - )!, - x3: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}x3'], - )!, - y3: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}y3'], - )!, - x4: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}x4'], - )!, - y4: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}y4'], - )!, - boxScore: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}box_score'], - )!, - textScore: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}text_score'], - )!, - recognizedText: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}recognized_text'], - )!, - isVisible: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_visible'], - )!, - ); - } - - @override - $AssetOcrEntityTable createAlias(String alias) { - return $AssetOcrEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetOcrEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String assetId; - final double x1; - final double y1; - final double x2; - final double y2; - final double x3; - final double y3; - final double x4; - final double y4; - final double boxScore; - final double textScore; - final String recognizedText; - final bool isVisible; - const AssetOcrEntityData({ - required this.id, - required this.assetId, - required this.x1, - required this.y1, - required this.x2, - required this.y2, - required this.x3, - required this.y3, - required this.x4, - required this.y4, - required this.boxScore, - required this.textScore, - required this.recognizedText, - required this.isVisible, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['asset_id'] = i0.Variable(assetId); - map['x1'] = i0.Variable(x1); - map['y1'] = i0.Variable(y1); - map['x2'] = i0.Variable(x2); - map['y2'] = i0.Variable(y2); - map['x3'] = i0.Variable(x3); - map['y3'] = i0.Variable(y3); - map['x4'] = i0.Variable(x4); - map['y4'] = i0.Variable(y4); - map['box_score'] = i0.Variable(boxScore); - map['text_score'] = i0.Variable(textScore); - map['recognized_text'] = i0.Variable(recognizedText); - map['is_visible'] = i0.Variable(isVisible); - return map; - } - - factory AssetOcrEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return AssetOcrEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - x1: serializer.fromJson(json['x1']), - y1: serializer.fromJson(json['y1']), - x2: serializer.fromJson(json['x2']), - y2: serializer.fromJson(json['y2']), - x3: serializer.fromJson(json['x3']), - y3: serializer.fromJson(json['y3']), - x4: serializer.fromJson(json['x4']), - y4: serializer.fromJson(json['y4']), - boxScore: serializer.fromJson(json['boxScore']), - textScore: serializer.fromJson(json['textScore']), - recognizedText: serializer.fromJson(json['recognizedText']), - isVisible: serializer.fromJson(json['isVisible']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'x1': serializer.toJson(x1), - 'y1': serializer.toJson(y1), - 'x2': serializer.toJson(x2), - 'y2': serializer.toJson(y2), - 'x3': serializer.toJson(x3), - 'y3': serializer.toJson(y3), - 'x4': serializer.toJson(x4), - 'y4': serializer.toJson(y4), - 'boxScore': serializer.toJson(boxScore), - 'textScore': serializer.toJson(textScore), - 'recognizedText': serializer.toJson(recognizedText), - 'isVisible': serializer.toJson(isVisible), - }; - } - - i1.AssetOcrEntityData copyWith({ - String? id, - String? assetId, - double? x1, - double? y1, - double? x2, - double? y2, - double? x3, - double? y3, - double? x4, - double? y4, - double? boxScore, - double? textScore, - String? recognizedText, - bool? isVisible, - }) => i1.AssetOcrEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - AssetOcrEntityData copyWithCompanion(i1.AssetOcrEntityCompanion data) { - return AssetOcrEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - x1: data.x1.present ? data.x1.value : this.x1, - y1: data.y1.present ? data.y1.value : this.y1, - x2: data.x2.present ? data.x2.value : this.x2, - y2: data.y2.present ? data.y2.value : this.y2, - x3: data.x3.present ? data.x3.value : this.x3, - y3: data.y3.present ? data.y3.value : this.y3, - x4: data.x4.present ? data.x4.value : this.x4, - y4: data.y4.present ? data.y4.value : this.y4, - boxScore: data.boxScore.present ? data.boxScore.value : this.boxScore, - textScore: data.textScore.present ? data.textScore.value : this.textScore, - recognizedText: data.recognizedText.present - ? data.recognizedText.value - : this.recognizedText, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - ); - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.AssetOcrEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.x1 == this.x1 && - other.y1 == this.y1 && - other.x2 == this.x2 && - other.y2 == this.y2 && - other.x3 == this.x3 && - other.y3 == this.y3 && - other.x4 == this.x4 && - other.y4 == this.y4 && - other.boxScore == this.boxScore && - other.textScore == this.textScore && - other.recognizedText == this.recognizedText && - other.isVisible == this.isVisible); -} - -class AssetOcrEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value assetId; - final i0.Value x1; - final i0.Value y1; - final i0.Value x2; - final i0.Value y2; - final i0.Value x3; - final i0.Value y3; - final i0.Value x4; - final i0.Value y4; - final i0.Value boxScore; - final i0.Value textScore; - final i0.Value recognizedText; - final i0.Value isVisible; - const AssetOcrEntityCompanion({ - this.id = const i0.Value.absent(), - this.assetId = const i0.Value.absent(), - this.x1 = const i0.Value.absent(), - this.y1 = const i0.Value.absent(), - this.x2 = const i0.Value.absent(), - this.y2 = const i0.Value.absent(), - this.x3 = const i0.Value.absent(), - this.y3 = const i0.Value.absent(), - this.x4 = const i0.Value.absent(), - this.y4 = const i0.Value.absent(), - this.boxScore = const i0.Value.absent(), - this.textScore = const i0.Value.absent(), - this.recognizedText = const i0.Value.absent(), - this.isVisible = const i0.Value.absent(), - }); - AssetOcrEntityCompanion.insert({ - required String id, - required String assetId, - required double x1, - required double y1, - required double x2, - required double y2, - required double x3, - required double y3, - required double x4, - required double y4, - required double boxScore, - required double textScore, - required String recognizedText, - this.isVisible = const i0.Value.absent(), - }) : id = i0.Value(id), - assetId = i0.Value(assetId), - x1 = i0.Value(x1), - y1 = i0.Value(y1), - x2 = i0.Value(x2), - y2 = i0.Value(y2), - x3 = i0.Value(x3), - y3 = i0.Value(y3), - x4 = i0.Value(x4), - y4 = i0.Value(y4), - boxScore = i0.Value(boxScore), - textScore = i0.Value(textScore), - recognizedText = i0.Value(recognizedText); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? assetId, - i0.Expression? x1, - i0.Expression? y1, - i0.Expression? x2, - i0.Expression? y2, - i0.Expression? x3, - i0.Expression? y3, - i0.Expression? x4, - i0.Expression? y4, - i0.Expression? boxScore, - i0.Expression? textScore, - i0.Expression? recognizedText, - i0.Expression? isVisible, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (x1 != null) 'x1': x1, - if (y1 != null) 'y1': y1, - if (x2 != null) 'x2': x2, - if (y2 != null) 'y2': y2, - if (x3 != null) 'x3': x3, - if (y3 != null) 'y3': y3, - if (x4 != null) 'x4': x4, - if (y4 != null) 'y4': y4, - if (boxScore != null) 'box_score': boxScore, - if (textScore != null) 'text_score': textScore, - if (recognizedText != null) 'recognized_text': recognizedText, - if (isVisible != null) 'is_visible': isVisible, - }); - } - - i1.AssetOcrEntityCompanion copyWith({ - i0.Value? id, - i0.Value? assetId, - i0.Value? x1, - i0.Value? y1, - i0.Value? x2, - i0.Value? y2, - i0.Value? x3, - i0.Value? y3, - i0.Value? x4, - i0.Value? y4, - i0.Value? boxScore, - i0.Value? textScore, - i0.Value? recognizedText, - i0.Value? isVisible, - }) { - return i1.AssetOcrEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (x1.present) { - map['x1'] = i0.Variable(x1.value); - } - if (y1.present) { - map['y1'] = i0.Variable(y1.value); - } - if (x2.present) { - map['x2'] = i0.Variable(x2.value); - } - if (y2.present) { - map['y2'] = i0.Variable(y2.value); - } - if (x3.present) { - map['x3'] = i0.Variable(x3.value); - } - if (y3.present) { - map['y3'] = i0.Variable(y3.value); - } - if (x4.present) { - map['x4'] = i0.Variable(x4.value); - } - if (y4.present) { - map['y4'] = i0.Variable(y4.value); - } - if (boxScore.present) { - map['box_score'] = i0.Variable(boxScore.value); - } - if (textScore.present) { - map['text_score'] = i0.Variable(textScore.value); - } - if (recognizedText.present) { - map['recognized_text'] = i0.Variable(recognizedText.value); - } - if (isVisible.present) { - map['is_visible'] = i0.Variable(isVisible.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/auth_user.entity.drift.dart b/mobile/lib/infrastructure/entities/auth_user.entity.drift.dart deleted file mode 100644 index 4dba1c42fb..0000000000 --- a/mobile/lib/infrastructure/entities/auth_user.entity.drift.dart +++ /dev/null @@ -1,933 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/user.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/auth_user.entity.dart' - as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; - -typedef $$AuthUserEntityTableCreateCompanionBuilder = - i1.AuthUserEntityCompanion Function({ - required String id, - required String name, - required String email, - i0.Value isAdmin, - i0.Value hasProfileImage, - i0.Value profileChangedAt, - required i2.AvatarColor avatarColor, - i0.Value quotaSizeInBytes, - i0.Value quotaUsageInBytes, - i0.Value pinCode, - }); -typedef $$AuthUserEntityTableUpdateCompanionBuilder = - i1.AuthUserEntityCompanion Function({ - i0.Value id, - i0.Value name, - i0.Value email, - i0.Value isAdmin, - i0.Value hasProfileImage, - i0.Value profileChangedAt, - i0.Value avatarColor, - i0.Value quotaSizeInBytes, - i0.Value quotaUsageInBytes, - i0.Value pinCode, - }); - -class $$AuthUserEntityTableFilterComposer - extends i0.Composer { - $$AuthUserEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get email => $composableBuilder( - column: $table.email, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isAdmin => $composableBuilder( - column: $table.isAdmin, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get hasProfileImage => $composableBuilder( - column: $table.hasProfileImage, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get profileChangedAt => $composableBuilder( - column: $table.profileChangedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get avatarColor => $composableBuilder( - column: $table.avatarColor, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get quotaSizeInBytes => $composableBuilder( - column: $table.quotaSizeInBytes, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get quotaUsageInBytes => $composableBuilder( - column: $table.quotaUsageInBytes, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get pinCode => $composableBuilder( - column: $table.pinCode, - builder: (column) => i0.ColumnFilters(column), - ); -} - -class $$AuthUserEntityTableOrderingComposer - extends i0.Composer { - $$AuthUserEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get email => $composableBuilder( - column: $table.email, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isAdmin => $composableBuilder( - column: $table.isAdmin, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get hasProfileImage => $composableBuilder( - column: $table.hasProfileImage, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get profileChangedAt => $composableBuilder( - column: $table.profileChangedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get avatarColor => $composableBuilder( - column: $table.avatarColor, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get quotaSizeInBytes => $composableBuilder( - column: $table.quotaSizeInBytes, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get quotaUsageInBytes => $composableBuilder( - column: $table.quotaUsageInBytes, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get pinCode => $composableBuilder( - column: $table.pinCode, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$AuthUserEntityTableAnnotationComposer - extends i0.Composer { - $$AuthUserEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumn get email => - $composableBuilder(column: $table.email, builder: (column) => column); - - i0.GeneratedColumn get isAdmin => - $composableBuilder(column: $table.isAdmin, builder: (column) => column); - - i0.GeneratedColumn get hasProfileImage => $composableBuilder( - column: $table.hasProfileImage, - builder: (column) => column, - ); - - i0.GeneratedColumn get profileChangedAt => $composableBuilder( - column: $table.profileChangedAt, - builder: (column) => column, - ); - - i0.GeneratedColumnWithTypeConverter get avatarColor => - $composableBuilder( - column: $table.avatarColor, - builder: (column) => column, - ); - - i0.GeneratedColumn get quotaSizeInBytes => $composableBuilder( - column: $table.quotaSizeInBytes, - builder: (column) => column, - ); - - i0.GeneratedColumn get quotaUsageInBytes => $composableBuilder( - column: $table.quotaUsageInBytes, - builder: (column) => column, - ); - - i0.GeneratedColumn get pinCode => - $composableBuilder(column: $table.pinCode, builder: (column) => column); -} - -class $$AuthUserEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$AuthUserEntityTable, - i1.AuthUserEntityData, - i1.$$AuthUserEntityTableFilterComposer, - i1.$$AuthUserEntityTableOrderingComposer, - i1.$$AuthUserEntityTableAnnotationComposer, - $$AuthUserEntityTableCreateCompanionBuilder, - $$AuthUserEntityTableUpdateCompanionBuilder, - ( - i1.AuthUserEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$AuthUserEntityTable, - i1.AuthUserEntityData - >, - ), - i1.AuthUserEntityData, - i0.PrefetchHooks Function() - > { - $$AuthUserEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$AuthUserEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$AuthUserEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$AuthUserEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => i1 - .$$AuthUserEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value name = const i0.Value.absent(), - i0.Value email = const i0.Value.absent(), - i0.Value isAdmin = const i0.Value.absent(), - i0.Value hasProfileImage = const i0.Value.absent(), - i0.Value profileChangedAt = const i0.Value.absent(), - i0.Value avatarColor = const i0.Value.absent(), - i0.Value quotaSizeInBytes = const i0.Value.absent(), - i0.Value quotaUsageInBytes = const i0.Value.absent(), - i0.Value pinCode = const i0.Value.absent(), - }) => i1.AuthUserEntityCompanion( - id: id, - name: name, - email: email, - isAdmin: isAdmin, - hasProfileImage: hasProfileImage, - profileChangedAt: profileChangedAt, - avatarColor: avatarColor, - quotaSizeInBytes: quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes, - pinCode: pinCode, - ), - createCompanionCallback: - ({ - required String id, - required String name, - required String email, - i0.Value isAdmin = const i0.Value.absent(), - i0.Value hasProfileImage = const i0.Value.absent(), - i0.Value profileChangedAt = const i0.Value.absent(), - required i2.AvatarColor avatarColor, - i0.Value quotaSizeInBytes = const i0.Value.absent(), - i0.Value quotaUsageInBytes = const i0.Value.absent(), - i0.Value pinCode = const i0.Value.absent(), - }) => i1.AuthUserEntityCompanion.insert( - id: id, - name: name, - email: email, - isAdmin: isAdmin, - hasProfileImage: hasProfileImage, - profileChangedAt: profileChangedAt, - avatarColor: avatarColor, - quotaSizeInBytes: quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes, - pinCode: pinCode, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$AuthUserEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$AuthUserEntityTable, - i1.AuthUserEntityData, - i1.$$AuthUserEntityTableFilterComposer, - i1.$$AuthUserEntityTableOrderingComposer, - i1.$$AuthUserEntityTableAnnotationComposer, - $$AuthUserEntityTableCreateCompanionBuilder, - $$AuthUserEntityTableUpdateCompanionBuilder, - ( - i1.AuthUserEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$AuthUserEntityTable, - i1.AuthUserEntityData - >, - ), - i1.AuthUserEntityData, - i0.PrefetchHooks Function() - >; - -class $AuthUserEntityTable extends i3.AuthUserEntity - with i0.TableInfo<$AuthUserEntityTable, i1.AuthUserEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $AuthUserEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _emailMeta = const i0.VerificationMeta( - 'email', - ); - @override - late final i0.GeneratedColumn email = i0.GeneratedColumn( - 'email', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _isAdminMeta = const i0.VerificationMeta( - 'isAdmin', - ); - @override - late final i0.GeneratedColumn isAdmin = i0.GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _hasProfileImageMeta = - const i0.VerificationMeta('hasProfileImage'); - @override - late final i0.GeneratedColumn hasProfileImage = - i0.GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _profileChangedAtMeta = - const i0.VerificationMeta('profileChangedAt'); - @override - late final i0.GeneratedColumn profileChangedAt = - i0.GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - @override - late final i0.GeneratedColumnWithTypeConverter - avatarColor = - i0.GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$AuthUserEntityTable.$converteravatarColor, - ); - static const i0.VerificationMeta _quotaSizeInBytesMeta = - const i0.VerificationMeta('quotaSizeInBytes'); - @override - late final i0.GeneratedColumn quotaSizeInBytes = i0.GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ); - static const i0.VerificationMeta _quotaUsageInBytesMeta = - const i0.VerificationMeta('quotaUsageInBytes'); - @override - late final i0.GeneratedColumn quotaUsageInBytes = - i0.GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ); - static const i0.VerificationMeta _pinCodeMeta = const i0.VerificationMeta( - 'pinCode', - ); - @override - late final i0.GeneratedColumn pinCode = i0.GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('email')) { - context.handle( - _emailMeta, - email.isAcceptableOrUnknown(data['email']!, _emailMeta), - ); - } else if (isInserting) { - context.missing(_emailMeta); - } - if (data.containsKey('is_admin')) { - context.handle( - _isAdminMeta, - isAdmin.isAcceptableOrUnknown(data['is_admin']!, _isAdminMeta), - ); - } - if (data.containsKey('has_profile_image')) { - context.handle( - _hasProfileImageMeta, - hasProfileImage.isAcceptableOrUnknown( - data['has_profile_image']!, - _hasProfileImageMeta, - ), - ); - } - if (data.containsKey('profile_changed_at')) { - context.handle( - _profileChangedAtMeta, - profileChangedAt.isAcceptableOrUnknown( - data['profile_changed_at']!, - _profileChangedAtMeta, - ), - ); - } - if (data.containsKey('quota_size_in_bytes')) { - context.handle( - _quotaSizeInBytesMeta, - quotaSizeInBytes.isAcceptableOrUnknown( - data['quota_size_in_bytes']!, - _quotaSizeInBytesMeta, - ), - ); - } - if (data.containsKey('quota_usage_in_bytes')) { - context.handle( - _quotaUsageInBytesMeta, - quotaUsageInBytes.isAcceptableOrUnknown( - data['quota_usage_in_bytes']!, - _quotaUsageInBytesMeta, - ), - ); - } - if (data.containsKey('pin_code')) { - context.handle( - _pinCodeMeta, - pinCode.isAcceptableOrUnknown(data['pin_code']!, _pinCodeMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: i1.$AuthUserEntityTable.$converteravatarColor.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ), - quotaSizeInBytes: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - $AuthUserEntityTable createAlias(String alias) { - return $AuthUserEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converteravatarColor = - const i0.EnumIndexConverter(i2.AvatarColor.values); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final i2.AvatarColor avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['name'] = i0.Variable(name); - map['email'] = i0.Variable(email); - map['is_admin'] = i0.Variable(isAdmin); - map['has_profile_image'] = i0.Variable(hasProfileImage); - map['profile_changed_at'] = i0.Variable(profileChangedAt); - { - map['avatar_color'] = i0.Variable( - i1.$AuthUserEntityTable.$converteravatarColor.toSql(avatarColor), - ); - } - map['quota_size_in_bytes'] = i0.Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = i0.Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = i0.Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: i1.$AuthUserEntityTable.$converteravatarColor.fromJson( - serializer.fromJson(json['avatarColor']), - ), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson( - i1.$AuthUserEntityTable.$converteravatarColor.toJson(avatarColor), - ), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - i1.AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - i2.AvatarColor? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - i0.Value pinCode = const i0.Value.absent(), - }) => i1.AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(i1.AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value name; - final i0.Value email; - final i0.Value isAdmin; - final i0.Value hasProfileImage; - final i0.Value profileChangedAt; - final i0.Value avatarColor; - final i0.Value quotaSizeInBytes; - final i0.Value quotaUsageInBytes; - final i0.Value pinCode; - const AuthUserEntityCompanion({ - this.id = const i0.Value.absent(), - this.name = const i0.Value.absent(), - this.email = const i0.Value.absent(), - this.isAdmin = const i0.Value.absent(), - this.hasProfileImage = const i0.Value.absent(), - this.profileChangedAt = const i0.Value.absent(), - this.avatarColor = const i0.Value.absent(), - this.quotaSizeInBytes = const i0.Value.absent(), - this.quotaUsageInBytes = const i0.Value.absent(), - this.pinCode = const i0.Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const i0.Value.absent(), - this.hasProfileImage = const i0.Value.absent(), - this.profileChangedAt = const i0.Value.absent(), - required i2.AvatarColor avatarColor, - this.quotaSizeInBytes = const i0.Value.absent(), - this.quotaUsageInBytes = const i0.Value.absent(), - this.pinCode = const i0.Value.absent(), - }) : id = i0.Value(id), - name = i0.Value(name), - email = i0.Value(email), - avatarColor = i0.Value(avatarColor); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? name, - i0.Expression? email, - i0.Expression? isAdmin, - i0.Expression? hasProfileImage, - i0.Expression? profileChangedAt, - i0.Expression? avatarColor, - i0.Expression? quotaSizeInBytes, - i0.Expression? quotaUsageInBytes, - i0.Expression? pinCode, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - i1.AuthUserEntityCompanion copyWith({ - i0.Value? id, - i0.Value? name, - i0.Value? email, - i0.Value? isAdmin, - i0.Value? hasProfileImage, - i0.Value? profileChangedAt, - i0.Value? avatarColor, - i0.Value? quotaSizeInBytes, - i0.Value? quotaUsageInBytes, - i0.Value? pinCode, - }) { - return i1.AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (email.present) { - map['email'] = i0.Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = i0.Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = i0.Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = i0.Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = i0.Variable( - i1.$AuthUserEntityTable.$converteravatarColor.toSql(avatarColor.value), - ); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = i0.Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = i0.Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = i0.Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/exif.entity.drift.dart b/mobile/lib/infrastructure/entities/exif.entity.drift.dart deleted file mode 100644 index 70b0793601..0000000000 --- a/mobile/lib/infrastructure/entities/exif.entity.drift.dart +++ /dev/null @@ -1,1881 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/exif.entity.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i3; -import 'package:drift/internal/modular.dart' as i4; - -typedef $$RemoteExifEntityTableCreateCompanionBuilder = - i1.RemoteExifEntityCompanion Function({ - required String assetId, - i0.Value city, - i0.Value state, - i0.Value country, - i0.Value dateTimeOriginal, - i0.Value description, - i0.Value height, - i0.Value width, - i0.Value exposureTime, - i0.Value fNumber, - i0.Value fileSize, - i0.Value focalLength, - i0.Value latitude, - i0.Value longitude, - i0.Value iso, - i0.Value make, - i0.Value model, - i0.Value lens, - i0.Value orientation, - i0.Value timeZone, - i0.Value rating, - i0.Value projectionType, - }); -typedef $$RemoteExifEntityTableUpdateCompanionBuilder = - i1.RemoteExifEntityCompanion Function({ - i0.Value assetId, - i0.Value city, - i0.Value state, - i0.Value country, - i0.Value dateTimeOriginal, - i0.Value description, - i0.Value height, - i0.Value width, - i0.Value exposureTime, - i0.Value fNumber, - i0.Value fileSize, - i0.Value focalLength, - i0.Value latitude, - i0.Value longitude, - i0.Value iso, - i0.Value make, - i0.Value model, - i0.Value lens, - i0.Value orientation, - i0.Value timeZone, - i0.Value rating, - i0.Value projectionType, - }); - -final class $$RemoteExifEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$RemoteExifEntityTable, - i1.RemoteExifEntityData - > { - $$RemoteExifEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias('remote_exif_entity__asset_id__remote_asset_entity__id'); - - i3.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i3 - .$$RemoteAssetEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$RemoteExifEntityTableFilterComposer - extends i0.Composer { - $$RemoteExifEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get city => $composableBuilder( - column: $table.city, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get state => $composableBuilder( - column: $table.state, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get country => $composableBuilder( - column: $table.country, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get dateTimeOriginal => $composableBuilder( - column: $table.dateTimeOriginal, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get description => $composableBuilder( - column: $table.description, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get exposureTime => $composableBuilder( - column: $table.exposureTime, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get fNumber => $composableBuilder( - column: $table.fNumber, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get fileSize => $composableBuilder( - column: $table.fileSize, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get focalLength => $composableBuilder( - column: $table.focalLength, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get latitude => $composableBuilder( - column: $table.latitude, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get longitude => $composableBuilder( - column: $table.longitude, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get iso => $composableBuilder( - column: $table.iso, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get make => $composableBuilder( - column: $table.make, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get model => $composableBuilder( - column: $table.model, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get lens => $composableBuilder( - column: $table.lens, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get timeZone => $composableBuilder( - column: $table.timeZone, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get rating => $composableBuilder( - column: $table.rating, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get projectionType => $composableBuilder( - column: $table.projectionType, - builder: (column) => i0.ColumnFilters(column), - ); - - i3.$$RemoteAssetEntityTableFilterComposer get assetId { - final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteExifEntityTableOrderingComposer - extends i0.Composer { - $$RemoteExifEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get city => $composableBuilder( - column: $table.city, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get state => $composableBuilder( - column: $table.state, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get country => $composableBuilder( - column: $table.country, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get dateTimeOriginal => $composableBuilder( - column: $table.dateTimeOriginal, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get description => $composableBuilder( - column: $table.description, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get exposureTime => $composableBuilder( - column: $table.exposureTime, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get fNumber => $composableBuilder( - column: $table.fNumber, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get fileSize => $composableBuilder( - column: $table.fileSize, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get focalLength => $composableBuilder( - column: $table.focalLength, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get latitude => $composableBuilder( - column: $table.latitude, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get longitude => $composableBuilder( - column: $table.longitude, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get iso => $composableBuilder( - column: $table.iso, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get make => $composableBuilder( - column: $table.make, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get model => $composableBuilder( - column: $table.model, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get lens => $composableBuilder( - column: $table.lens, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get timeZone => $composableBuilder( - column: $table.timeZone, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get rating => $composableBuilder( - column: $table.rating, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get projectionType => $composableBuilder( - column: $table.projectionType, - builder: (column) => i0.ColumnOrderings(column), - ); - - i3.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i3.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteExifEntityTableAnnotationComposer - extends i0.Composer { - $$RemoteExifEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get city => - $composableBuilder(column: $table.city, builder: (column) => column); - - i0.GeneratedColumn get state => - $composableBuilder(column: $table.state, builder: (column) => column); - - i0.GeneratedColumn get country => - $composableBuilder(column: $table.country, builder: (column) => column); - - i0.GeneratedColumn get dateTimeOriginal => $composableBuilder( - column: $table.dateTimeOriginal, - builder: (column) => column, - ); - - i0.GeneratedColumn get description => $composableBuilder( - column: $table.description, - builder: (column) => column, - ); - - i0.GeneratedColumn get height => - $composableBuilder(column: $table.height, builder: (column) => column); - - i0.GeneratedColumn get width => - $composableBuilder(column: $table.width, builder: (column) => column); - - i0.GeneratedColumn get exposureTime => $composableBuilder( - column: $table.exposureTime, - builder: (column) => column, - ); - - i0.GeneratedColumn get fNumber => - $composableBuilder(column: $table.fNumber, builder: (column) => column); - - i0.GeneratedColumn get fileSize => - $composableBuilder(column: $table.fileSize, builder: (column) => column); - - i0.GeneratedColumn get focalLength => $composableBuilder( - column: $table.focalLength, - builder: (column) => column, - ); - - i0.GeneratedColumn get latitude => - $composableBuilder(column: $table.latitude, builder: (column) => column); - - i0.GeneratedColumn get longitude => - $composableBuilder(column: $table.longitude, builder: (column) => column); - - i0.GeneratedColumn get iso => - $composableBuilder(column: $table.iso, builder: (column) => column); - - i0.GeneratedColumn get make => - $composableBuilder(column: $table.make, builder: (column) => column); - - i0.GeneratedColumn get model => - $composableBuilder(column: $table.model, builder: (column) => column); - - i0.GeneratedColumn get lens => - $composableBuilder(column: $table.lens, builder: (column) => column); - - i0.GeneratedColumn get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => column, - ); - - i0.GeneratedColumn get timeZone => - $composableBuilder(column: $table.timeZone, builder: (column) => column); - - i0.GeneratedColumn get rating => - $composableBuilder(column: $table.rating, builder: (column) => column); - - i0.GeneratedColumn get projectionType => $composableBuilder( - column: $table.projectionType, - builder: (column) => column, - ); - - i3.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i3.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteExifEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$RemoteExifEntityTable, - i1.RemoteExifEntityData, - i1.$$RemoteExifEntityTableFilterComposer, - i1.$$RemoteExifEntityTableOrderingComposer, - i1.$$RemoteExifEntityTableAnnotationComposer, - $$RemoteExifEntityTableCreateCompanionBuilder, - $$RemoteExifEntityTableUpdateCompanionBuilder, - (i1.RemoteExifEntityData, i1.$$RemoteExifEntityTableReferences), - i1.RemoteExifEntityData, - i0.PrefetchHooks Function({bool assetId}) - > { - $$RemoteExifEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$RemoteExifEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$RemoteExifEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$RemoteExifEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$RemoteExifEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value assetId = const i0.Value.absent(), - i0.Value city = const i0.Value.absent(), - i0.Value state = const i0.Value.absent(), - i0.Value country = const i0.Value.absent(), - i0.Value dateTimeOriginal = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value exposureTime = const i0.Value.absent(), - i0.Value fNumber = const i0.Value.absent(), - i0.Value fileSize = const i0.Value.absent(), - i0.Value focalLength = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - i0.Value iso = const i0.Value.absent(), - i0.Value make = const i0.Value.absent(), - i0.Value model = const i0.Value.absent(), - i0.Value lens = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - i0.Value timeZone = const i0.Value.absent(), - i0.Value rating = const i0.Value.absent(), - i0.Value projectionType = const i0.Value.absent(), - }) => i1.RemoteExifEntityCompanion( - assetId: assetId, - city: city, - state: state, - country: country, - dateTimeOriginal: dateTimeOriginal, - description: description, - height: height, - width: width, - exposureTime: exposureTime, - fNumber: fNumber, - fileSize: fileSize, - focalLength: focalLength, - latitude: latitude, - longitude: longitude, - iso: iso, - make: make, - model: model, - lens: lens, - orientation: orientation, - timeZone: timeZone, - rating: rating, - projectionType: projectionType, - ), - createCompanionCallback: - ({ - required String assetId, - i0.Value city = const i0.Value.absent(), - i0.Value state = const i0.Value.absent(), - i0.Value country = const i0.Value.absent(), - i0.Value dateTimeOriginal = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value exposureTime = const i0.Value.absent(), - i0.Value fNumber = const i0.Value.absent(), - i0.Value fileSize = const i0.Value.absent(), - i0.Value focalLength = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - i0.Value iso = const i0.Value.absent(), - i0.Value make = const i0.Value.absent(), - i0.Value model = const i0.Value.absent(), - i0.Value lens = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - i0.Value timeZone = const i0.Value.absent(), - i0.Value rating = const i0.Value.absent(), - i0.Value projectionType = const i0.Value.absent(), - }) => i1.RemoteExifEntityCompanion.insert( - assetId: assetId, - city: city, - state: state, - country: country, - dateTimeOriginal: dateTimeOriginal, - description: description, - height: height, - width: width, - exposureTime: exposureTime, - fNumber: fNumber, - fileSize: fileSize, - focalLength: focalLength, - latitude: latitude, - longitude: longitude, - iso: iso, - make: make, - model: model, - lens: lens, - orientation: orientation, - timeZone: timeZone, - rating: rating, - projectionType: projectionType, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$RemoteExifEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$RemoteExifEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$RemoteExifEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$RemoteExifEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$RemoteExifEntityTable, - i1.RemoteExifEntityData, - i1.$$RemoteExifEntityTableFilterComposer, - i1.$$RemoteExifEntityTableOrderingComposer, - i1.$$RemoteExifEntityTableAnnotationComposer, - $$RemoteExifEntityTableCreateCompanionBuilder, - $$RemoteExifEntityTableUpdateCompanionBuilder, - (i1.RemoteExifEntityData, i1.$$RemoteExifEntityTableReferences), - i1.RemoteExifEntityData, - i0.PrefetchHooks Function({bool assetId}) - >; -i0.Index get idxLatLng => i0.Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', -); - -class $RemoteExifEntityTable extends i2.RemoteExifEntity - with i0.TableInfo<$RemoteExifEntityTable, i1.RemoteExifEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $RemoteExifEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _cityMeta = const i0.VerificationMeta( - 'city', - ); - @override - late final i0.GeneratedColumn city = i0.GeneratedColumn( - 'city', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _stateMeta = const i0.VerificationMeta( - 'state', - ); - @override - late final i0.GeneratedColumn state = i0.GeneratedColumn( - 'state', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _countryMeta = const i0.VerificationMeta( - 'country', - ); - @override - late final i0.GeneratedColumn country = i0.GeneratedColumn( - 'country', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _dateTimeOriginalMeta = - const i0.VerificationMeta('dateTimeOriginal'); - @override - late final i0.GeneratedColumn dateTimeOriginal = - i0.GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _descriptionMeta = const i0.VerificationMeta( - 'description', - ); - @override - late final i0.GeneratedColumn description = - i0.GeneratedColumn( - 'description', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _heightMeta = const i0.VerificationMeta( - 'height', - ); - @override - late final i0.GeneratedColumn height = i0.GeneratedColumn( - 'height', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _widthMeta = const i0.VerificationMeta( - 'width', - ); - @override - late final i0.GeneratedColumn width = i0.GeneratedColumn( - 'width', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _exposureTimeMeta = - const i0.VerificationMeta('exposureTime'); - @override - late final i0.GeneratedColumn exposureTime = - i0.GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _fNumberMeta = const i0.VerificationMeta( - 'fNumber', - ); - @override - late final i0.GeneratedColumn fNumber = i0.GeneratedColumn( - 'f_number', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _fileSizeMeta = const i0.VerificationMeta( - 'fileSize', - ); - @override - late final i0.GeneratedColumn fileSize = i0.GeneratedColumn( - 'file_size', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _focalLengthMeta = const i0.VerificationMeta( - 'focalLength', - ); - @override - late final i0.GeneratedColumn focalLength = - i0.GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _latitudeMeta = const i0.VerificationMeta( - 'latitude', - ); - @override - late final i0.GeneratedColumn latitude = i0.GeneratedColumn( - 'latitude', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _longitudeMeta = const i0.VerificationMeta( - 'longitude', - ); - @override - late final i0.GeneratedColumn longitude = i0.GeneratedColumn( - 'longitude', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _isoMeta = const i0.VerificationMeta('iso'); - @override - late final i0.GeneratedColumn iso = i0.GeneratedColumn( - 'iso', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _makeMeta = const i0.VerificationMeta( - 'make', - ); - @override - late final i0.GeneratedColumn make = i0.GeneratedColumn( - 'make', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _modelMeta = const i0.VerificationMeta( - 'model', - ); - @override - late final i0.GeneratedColumn model = i0.GeneratedColumn( - 'model', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _lensMeta = const i0.VerificationMeta( - 'lens', - ); - @override - late final i0.GeneratedColumn lens = i0.GeneratedColumn( - 'lens', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _orientationMeta = const i0.VerificationMeta( - 'orientation', - ); - @override - late final i0.GeneratedColumn orientation = - i0.GeneratedColumn( - 'orientation', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _timeZoneMeta = const i0.VerificationMeta( - 'timeZone', - ); - @override - late final i0.GeneratedColumn timeZone = i0.GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _ratingMeta = const i0.VerificationMeta( - 'rating', - ); - @override - late final i0.GeneratedColumn rating = i0.GeneratedColumn( - 'rating', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _projectionTypeMeta = - const i0.VerificationMeta('projectionType'); - @override - late final i0.GeneratedColumn projectionType = - i0.GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('city')) { - context.handle( - _cityMeta, - city.isAcceptableOrUnknown(data['city']!, _cityMeta), - ); - } - if (data.containsKey('state')) { - context.handle( - _stateMeta, - state.isAcceptableOrUnknown(data['state']!, _stateMeta), - ); - } - if (data.containsKey('country')) { - context.handle( - _countryMeta, - country.isAcceptableOrUnknown(data['country']!, _countryMeta), - ); - } - if (data.containsKey('date_time_original')) { - context.handle( - _dateTimeOriginalMeta, - dateTimeOriginal.isAcceptableOrUnknown( - data['date_time_original']!, - _dateTimeOriginalMeta, - ), - ); - } - if (data.containsKey('description')) { - context.handle( - _descriptionMeta, - description.isAcceptableOrUnknown( - data['description']!, - _descriptionMeta, - ), - ); - } - if (data.containsKey('height')) { - context.handle( - _heightMeta, - height.isAcceptableOrUnknown(data['height']!, _heightMeta), - ); - } - if (data.containsKey('width')) { - context.handle( - _widthMeta, - width.isAcceptableOrUnknown(data['width']!, _widthMeta), - ); - } - if (data.containsKey('exposure_time')) { - context.handle( - _exposureTimeMeta, - exposureTime.isAcceptableOrUnknown( - data['exposure_time']!, - _exposureTimeMeta, - ), - ); - } - if (data.containsKey('f_number')) { - context.handle( - _fNumberMeta, - fNumber.isAcceptableOrUnknown(data['f_number']!, _fNumberMeta), - ); - } - if (data.containsKey('file_size')) { - context.handle( - _fileSizeMeta, - fileSize.isAcceptableOrUnknown(data['file_size']!, _fileSizeMeta), - ); - } - if (data.containsKey('focal_length')) { - context.handle( - _focalLengthMeta, - focalLength.isAcceptableOrUnknown( - data['focal_length']!, - _focalLengthMeta, - ), - ); - } - if (data.containsKey('latitude')) { - context.handle( - _latitudeMeta, - latitude.isAcceptableOrUnknown(data['latitude']!, _latitudeMeta), - ); - } - if (data.containsKey('longitude')) { - context.handle( - _longitudeMeta, - longitude.isAcceptableOrUnknown(data['longitude']!, _longitudeMeta), - ); - } - if (data.containsKey('iso')) { - context.handle( - _isoMeta, - iso.isAcceptableOrUnknown(data['iso']!, _isoMeta), - ); - } - if (data.containsKey('make')) { - context.handle( - _makeMeta, - make.isAcceptableOrUnknown(data['make']!, _makeMeta), - ); - } - if (data.containsKey('model')) { - context.handle( - _modelMeta, - model.isAcceptableOrUnknown(data['model']!, _modelMeta), - ); - } - if (data.containsKey('lens')) { - context.handle( - _lensMeta, - lens.isAcceptableOrUnknown(data['lens']!, _lensMeta), - ); - } - if (data.containsKey('orientation')) { - context.handle( - _orientationMeta, - orientation.isAcceptableOrUnknown( - data['orientation']!, - _orientationMeta, - ), - ); - } - if (data.containsKey('time_zone')) { - context.handle( - _timeZoneMeta, - timeZone.isAcceptableOrUnknown(data['time_zone']!, _timeZoneMeta), - ); - } - if (data.containsKey('rating')) { - context.handle( - _ratingMeta, - rating.isAcceptableOrUnknown(data['rating']!, _ratingMeta), - ); - } - if (data.containsKey('projection_type')) { - context.handle( - _projectionTypeMeta, - projectionType.isAcceptableOrUnknown( - data['projection_type']!, - _projectionTypeMeta, - ), - ); - } - return context; - } - - @override - Set get $primaryKey => {assetId}; - @override - i1.RemoteExifEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - $RemoteExifEntityTable createAlias(String alias) { - return $RemoteExifEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends i0.DataClass - implements i0.Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = i0.Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = i0.Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = i0.Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = i0.Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = i0.Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = i0.Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = i0.Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = i0.Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = i0.Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = i0.Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = i0.Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = i0.Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = i0.Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = i0.Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = i0.Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = i0.Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = i0.Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = i0.Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = i0.Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = i0.Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = i0.Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = i0.Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - i1.RemoteExifEntityData copyWith({ - String? assetId, - i0.Value city = const i0.Value.absent(), - i0.Value state = const i0.Value.absent(), - i0.Value country = const i0.Value.absent(), - i0.Value dateTimeOriginal = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value exposureTime = const i0.Value.absent(), - i0.Value fNumber = const i0.Value.absent(), - i0.Value fileSize = const i0.Value.absent(), - i0.Value focalLength = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - i0.Value iso = const i0.Value.absent(), - i0.Value make = const i0.Value.absent(), - i0.Value model = const i0.Value.absent(), - i0.Value lens = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - i0.Value timeZone = const i0.Value.absent(), - i0.Value rating = const i0.Value.absent(), - i0.Value projectionType = const i0.Value.absent(), - }) => i1.RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(i1.RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion - extends i0.UpdateCompanion { - final i0.Value assetId; - final i0.Value city; - final i0.Value state; - final i0.Value country; - final i0.Value dateTimeOriginal; - final i0.Value description; - final i0.Value height; - final i0.Value width; - final i0.Value exposureTime; - final i0.Value fNumber; - final i0.Value fileSize; - final i0.Value focalLength; - final i0.Value latitude; - final i0.Value longitude; - final i0.Value iso; - final i0.Value make; - final i0.Value model; - final i0.Value lens; - final i0.Value orientation; - final i0.Value timeZone; - final i0.Value rating; - final i0.Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const i0.Value.absent(), - this.city = const i0.Value.absent(), - this.state = const i0.Value.absent(), - this.country = const i0.Value.absent(), - this.dateTimeOriginal = const i0.Value.absent(), - this.description = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.exposureTime = const i0.Value.absent(), - this.fNumber = const i0.Value.absent(), - this.fileSize = const i0.Value.absent(), - this.focalLength = const i0.Value.absent(), - this.latitude = const i0.Value.absent(), - this.longitude = const i0.Value.absent(), - this.iso = const i0.Value.absent(), - this.make = const i0.Value.absent(), - this.model = const i0.Value.absent(), - this.lens = const i0.Value.absent(), - this.orientation = const i0.Value.absent(), - this.timeZone = const i0.Value.absent(), - this.rating = const i0.Value.absent(), - this.projectionType = const i0.Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const i0.Value.absent(), - this.state = const i0.Value.absent(), - this.country = const i0.Value.absent(), - this.dateTimeOriginal = const i0.Value.absent(), - this.description = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.exposureTime = const i0.Value.absent(), - this.fNumber = const i0.Value.absent(), - this.fileSize = const i0.Value.absent(), - this.focalLength = const i0.Value.absent(), - this.latitude = const i0.Value.absent(), - this.longitude = const i0.Value.absent(), - this.iso = const i0.Value.absent(), - this.make = const i0.Value.absent(), - this.model = const i0.Value.absent(), - this.lens = const i0.Value.absent(), - this.orientation = const i0.Value.absent(), - this.timeZone = const i0.Value.absent(), - this.rating = const i0.Value.absent(), - this.projectionType = const i0.Value.absent(), - }) : assetId = i0.Value(assetId); - static i0.Insertable custom({ - i0.Expression? assetId, - i0.Expression? city, - i0.Expression? state, - i0.Expression? country, - i0.Expression? dateTimeOriginal, - i0.Expression? description, - i0.Expression? height, - i0.Expression? width, - i0.Expression? exposureTime, - i0.Expression? fNumber, - i0.Expression? fileSize, - i0.Expression? focalLength, - i0.Expression? latitude, - i0.Expression? longitude, - i0.Expression? iso, - i0.Expression? make, - i0.Expression? model, - i0.Expression? lens, - i0.Expression? orientation, - i0.Expression? timeZone, - i0.Expression? rating, - i0.Expression? projectionType, - }) { - return i0.RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - i1.RemoteExifEntityCompanion copyWith({ - i0.Value? assetId, - i0.Value? city, - i0.Value? state, - i0.Value? country, - i0.Value? dateTimeOriginal, - i0.Value? description, - i0.Value? height, - i0.Value? width, - i0.Value? exposureTime, - i0.Value? fNumber, - i0.Value? fileSize, - i0.Value? focalLength, - i0.Value? latitude, - i0.Value? longitude, - i0.Value? iso, - i0.Value? make, - i0.Value? model, - i0.Value? lens, - i0.Value? orientation, - i0.Value? timeZone, - i0.Value? rating, - i0.Value? projectionType, - }) { - return i1.RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (city.present) { - map['city'] = i0.Variable(city.value); - } - if (state.present) { - map['state'] = i0.Variable(state.value); - } - if (country.present) { - map['country'] = i0.Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = i0.Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = i0.Variable(description.value); - } - if (height.present) { - map['height'] = i0.Variable(height.value); - } - if (width.present) { - map['width'] = i0.Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = i0.Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = i0.Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = i0.Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = i0.Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = i0.Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = i0.Variable(longitude.value); - } - if (iso.present) { - map['iso'] = i0.Variable(iso.value); - } - if (make.present) { - map['make'] = i0.Variable(make.value); - } - if (model.present) { - map['model'] = i0.Variable(model.value); - } - if (lens.present) { - map['lens'] = i0.Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = i0.Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = i0.Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = i0.Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = i0.Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -i0.Index get idxRemoteExifCity => i0.Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', -); diff --git a/mobile/lib/infrastructure/entities/local_album.entity.drift.dart b/mobile/lib/infrastructure/entities/local_album.entity.drift.dart deleted file mode 100644 index 1479ec813a..0000000000 --- a/mobile/lib/infrastructure/entities/local_album.entity.drift.dart +++ /dev/null @@ -1,897 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/album/local_album.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/local_album.entity.dart' - as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart' - as i5; -import 'package:drift/internal/modular.dart' as i6; - -typedef $$LocalAlbumEntityTableCreateCompanionBuilder = - i1.LocalAlbumEntityCompanion Function({ - required String id, - required String name, - i0.Value updatedAt, - required i2.BackupSelection backupSelection, - i0.Value isIosSharedAlbum, - i0.Value linkedRemoteAlbumId, - i0.Value marker_, - }); -typedef $$LocalAlbumEntityTableUpdateCompanionBuilder = - i1.LocalAlbumEntityCompanion Function({ - i0.Value id, - i0.Value name, - i0.Value updatedAt, - i0.Value backupSelection, - i0.Value isIosSharedAlbum, - i0.Value linkedRemoteAlbumId, - i0.Value marker_, - }); - -final class $$LocalAlbumEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$LocalAlbumEntityTable, - i1.LocalAlbumEntityData - > { - $$LocalAlbumEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i5.$RemoteAlbumEntityTable _linkedRemoteAlbumIdTable( - i0.GeneratedDatabase db, - ) => i6.ReadDatabaseContainer(db) - .resultSet('remote_album_entity') - .createAlias( - 'local_album_entity__linked_remote_album_id__remote_album_entity__id', - ); - - i5.$$RemoteAlbumEntityTableProcessedTableManager? get linkedRemoteAlbumId { - final $_column = $_itemColumn('linked_remote_album_id'); - if ($_column == null) return null; - final manager = i5 - .$$RemoteAlbumEntityTableTableManager( - $_db, - i6.ReadDatabaseContainer( - $_db, - ).resultSet('remote_album_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_linkedRemoteAlbumIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$LocalAlbumEntityTableFilterComposer - extends i0.Composer { - $$LocalAlbumEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get backupSelection => $composableBuilder( - column: $table.backupSelection, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get isIosSharedAlbum => $composableBuilder( - column: $table.isIosSharedAlbum, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get marker_ => $composableBuilder( - column: $table.marker_, - builder: (column) => i0.ColumnFilters(column), - ); - - i5.$$RemoteAlbumEntityTableFilterComposer get linkedRemoteAlbumId { - final i5.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.linkedRemoteAlbumId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAlbumEntityTableFilterComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$LocalAlbumEntityTableOrderingComposer - extends i0.Composer { - $$LocalAlbumEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get backupSelection => $composableBuilder( - column: $table.backupSelection, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isIosSharedAlbum => $composableBuilder( - column: $table.isIosSharedAlbum, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get marker_ => $composableBuilder( - column: $table.marker_, - builder: (column) => i0.ColumnOrderings(column), - ); - - i5.$$RemoteAlbumEntityTableOrderingComposer get linkedRemoteAlbumId { - final i5.$$RemoteAlbumEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.linkedRemoteAlbumId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAlbumEntityTableOrderingComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$LocalAlbumEntityTableAnnotationComposer - extends i0.Composer { - $$LocalAlbumEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter - get backupSelection => $composableBuilder( - column: $table.backupSelection, - builder: (column) => column, - ); - - i0.GeneratedColumn get isIosSharedAlbum => $composableBuilder( - column: $table.isIosSharedAlbum, - builder: (column) => column, - ); - - i0.GeneratedColumn get marker_ => - $composableBuilder(column: $table.marker_, builder: (column) => column); - - i5.$$RemoteAlbumEntityTableAnnotationComposer get linkedRemoteAlbumId { - final i5.$$RemoteAlbumEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.linkedRemoteAlbumId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAlbumEntityTableAnnotationComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$LocalAlbumEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$LocalAlbumEntityTable, - i1.LocalAlbumEntityData, - i1.$$LocalAlbumEntityTableFilterComposer, - i1.$$LocalAlbumEntityTableOrderingComposer, - i1.$$LocalAlbumEntityTableAnnotationComposer, - $$LocalAlbumEntityTableCreateCompanionBuilder, - $$LocalAlbumEntityTableUpdateCompanionBuilder, - (i1.LocalAlbumEntityData, i1.$$LocalAlbumEntityTableReferences), - i1.LocalAlbumEntityData, - i0.PrefetchHooks Function({bool linkedRemoteAlbumId}) - > { - $$LocalAlbumEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$LocalAlbumEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$LocalAlbumEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$LocalAlbumEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$LocalAlbumEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value name = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value backupSelection = - const i0.Value.absent(), - i0.Value isIosSharedAlbum = const i0.Value.absent(), - i0.Value linkedRemoteAlbumId = const i0.Value.absent(), - i0.Value marker_ = const i0.Value.absent(), - }) => i1.LocalAlbumEntityCompanion( - id: id, - name: name, - updatedAt: updatedAt, - backupSelection: backupSelection, - isIosSharedAlbum: isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId, - marker_: marker_, - ), - createCompanionCallback: - ({ - required String id, - required String name, - i0.Value updatedAt = const i0.Value.absent(), - required i2.BackupSelection backupSelection, - i0.Value isIosSharedAlbum = const i0.Value.absent(), - i0.Value linkedRemoteAlbumId = const i0.Value.absent(), - i0.Value marker_ = const i0.Value.absent(), - }) => i1.LocalAlbumEntityCompanion.insert( - id: id, - name: name, - updatedAt: updatedAt, - backupSelection: backupSelection, - isIosSharedAlbum: isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId, - marker_: marker_, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$LocalAlbumEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({linkedRemoteAlbumId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (linkedRemoteAlbumId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.linkedRemoteAlbumId, - referencedTable: i1 - .$$LocalAlbumEntityTableReferences - ._linkedRemoteAlbumIdTable(db), - referencedColumn: i1 - .$$LocalAlbumEntityTableReferences - ._linkedRemoteAlbumIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$LocalAlbumEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$LocalAlbumEntityTable, - i1.LocalAlbumEntityData, - i1.$$LocalAlbumEntityTableFilterComposer, - i1.$$LocalAlbumEntityTableOrderingComposer, - i1.$$LocalAlbumEntityTableAnnotationComposer, - $$LocalAlbumEntityTableCreateCompanionBuilder, - $$LocalAlbumEntityTableUpdateCompanionBuilder, - (i1.LocalAlbumEntityData, i1.$$LocalAlbumEntityTableReferences), - i1.LocalAlbumEntityData, - i0.PrefetchHooks Function({bool linkedRemoteAlbumId}) - >; - -class $LocalAlbumEntityTable extends i3.LocalAlbumEntity - with i0.TableInfo<$LocalAlbumEntityTable, i1.LocalAlbumEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $LocalAlbumEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - @override - late final i0.GeneratedColumnWithTypeConverter - backupSelection = - i0.GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$LocalAlbumEntityTable.$converterbackupSelection, - ); - static const i0.VerificationMeta _isIosSharedAlbumMeta = - const i0.VerificationMeta('isIosSharedAlbum'); - @override - late final i0.GeneratedColumn isIosSharedAlbum = - i0.GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _linkedRemoteAlbumIdMeta = - const i0.VerificationMeta('linkedRemoteAlbumId'); - @override - late final i0.GeneratedColumn linkedRemoteAlbumId = - i0.GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - static const i0.VerificationMeta _marker_Meta = const i0.VerificationMeta( - 'marker_', - ); - @override - late final i0.GeneratedColumn marker_ = i0.GeneratedColumn( - 'marker', - aliasedName, - true, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('is_ios_shared_album')) { - context.handle( - _isIosSharedAlbumMeta, - isIosSharedAlbum.isAcceptableOrUnknown( - data['is_ios_shared_album']!, - _isIosSharedAlbumMeta, - ), - ); - } - if (data.containsKey('linked_remote_album_id')) { - context.handle( - _linkedRemoteAlbumIdMeta, - linkedRemoteAlbumId.isAcceptableOrUnknown( - data['linked_remote_album_id']!, - _linkedRemoteAlbumIdMeta, - ), - ); - } - if (data.containsKey('marker')) { - context.handle( - _marker_Meta, - marker_.isAcceptableOrUnknown(data['marker']!, _marker_Meta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.LocalAlbumEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: i1.$LocalAlbumEntityTable.$converterbackupSelection - .fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - ), - isIosSharedAlbum: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - $LocalAlbumEntityTable createAlias(String alias) { - return $LocalAlbumEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 - $converterbackupSelection = const i0.EnumIndexConverter( - i2.BackupSelection.values, - ); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String name; - final DateTime updatedAt; - final i2.BackupSelection backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['name'] = i0.Variable(name); - map['updated_at'] = i0.Variable(updatedAt); - { - map['backup_selection'] = i0.Variable( - i1.$LocalAlbumEntityTable.$converterbackupSelection.toSql( - backupSelection, - ), - ); - } - map['is_ios_shared_album'] = i0.Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = i0.Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = i0.Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: i1.$LocalAlbumEntityTable.$converterbackupSelection - .fromJson(serializer.fromJson(json['backupSelection'])), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson( - i1.$LocalAlbumEntityTable.$converterbackupSelection.toJson( - backupSelection, - ), - ), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - i1.LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - i2.BackupSelection? backupSelection, - bool? isIosSharedAlbum, - i0.Value linkedRemoteAlbumId = const i0.Value.absent(), - i0.Value marker_ = const i0.Value.absent(), - }) => i1.LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(i1.LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value name; - final i0.Value updatedAt; - final i0.Value backupSelection; - final i0.Value isIosSharedAlbum; - final i0.Value linkedRemoteAlbumId; - final i0.Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const i0.Value.absent(), - this.name = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.backupSelection = const i0.Value.absent(), - this.isIosSharedAlbum = const i0.Value.absent(), - this.linkedRemoteAlbumId = const i0.Value.absent(), - this.marker_ = const i0.Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const i0.Value.absent(), - required i2.BackupSelection backupSelection, - this.isIosSharedAlbum = const i0.Value.absent(), - this.linkedRemoteAlbumId = const i0.Value.absent(), - this.marker_ = const i0.Value.absent(), - }) : id = i0.Value(id), - name = i0.Value(name), - backupSelection = i0.Value(backupSelection); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? name, - i0.Expression? updatedAt, - i0.Expression? backupSelection, - i0.Expression? isIosSharedAlbum, - i0.Expression? linkedRemoteAlbumId, - i0.Expression? marker_, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - i1.LocalAlbumEntityCompanion copyWith({ - i0.Value? id, - i0.Value? name, - i0.Value? updatedAt, - i0.Value? backupSelection, - i0.Value? isIosSharedAlbum, - i0.Value? linkedRemoteAlbumId, - i0.Value? marker_, - }) { - return i1.LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = i0.Variable( - i1.$LocalAlbumEntityTable.$converterbackupSelection.toSql( - backupSelection.value, - ), - ); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = i0.Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = i0.Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = i0.Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/local_album_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/local_album_asset.entity.drift.dart deleted file mode 100644 index c4869a3593..0000000000 --- a/mobile/lib/infrastructure/entities/local_album_asset.entity.drift.dart +++ /dev/null @@ -1,721 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/local_album_asset.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/local_album_asset.entity.dart' - as i2; -import 'package:immich_mobile/infrastructure/entities/local_asset.entity.drift.dart' - as i3; -import 'package:drift/internal/modular.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.dart' - as i5; - -typedef $$LocalAlbumAssetEntityTableCreateCompanionBuilder = - i1.LocalAlbumAssetEntityCompanion Function({ - required String assetId, - required String albumId, - i0.Value marker_, - }); -typedef $$LocalAlbumAssetEntityTableUpdateCompanionBuilder = - i1.LocalAlbumAssetEntityCompanion Function({ - i0.Value assetId, - i0.Value albumId, - i0.Value marker_, - }); - -final class $$LocalAlbumAssetEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$LocalAlbumAssetEntityTable, - i1.LocalAlbumAssetEntityData - > { - $$LocalAlbumAssetEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i3.$LocalAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('local_asset_entity') - .createAlias( - 'local_album_asset_entity__asset_id__local_asset_entity__id', - ); - - i3.$$LocalAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i3 - .$$LocalAssetEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('local_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static i5.$LocalAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('local_album_entity') - .createAlias( - 'local_album_asset_entity__album_id__local_album_entity__id', - ); - - i5.$$LocalAlbumEntityTableProcessedTableManager get albumId { - final $_column = $_itemColumn('album_id')!; - - final manager = i5 - .$$LocalAlbumEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('local_album_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_albumIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$LocalAlbumAssetEntityTableFilterComposer - extends i0.Composer { - $$LocalAlbumAssetEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get marker_ => $composableBuilder( - column: $table.marker_, - builder: (column) => i0.ColumnFilters(column), - ); - - i3.$$LocalAssetEntityTableFilterComposer get assetId { - final i3.$$LocalAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$LocalAssetEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$LocalAlbumEntityTableFilterComposer get albumId { - final i5.$$LocalAlbumEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$LocalAlbumEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$LocalAlbumAssetEntityTableOrderingComposer - extends i0.Composer { - $$LocalAlbumAssetEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get marker_ => $composableBuilder( - column: $table.marker_, - builder: (column) => i0.ColumnOrderings(column), - ); - - i3.$$LocalAssetEntityTableOrderingComposer get assetId { - final i3.$$LocalAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$LocalAssetEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$LocalAlbumEntityTableOrderingComposer get albumId { - final i5.$$LocalAlbumEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$LocalAlbumEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$LocalAlbumAssetEntityTableAnnotationComposer - extends i0.Composer { - $$LocalAlbumAssetEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get marker_ => - $composableBuilder(column: $table.marker_, builder: (column) => column); - - i3.$$LocalAssetEntityTableAnnotationComposer get assetId { - final i3.$$LocalAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$LocalAssetEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$LocalAlbumEntityTableAnnotationComposer get albumId { - final i5.$$LocalAlbumEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$LocalAlbumEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('local_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$LocalAlbumAssetEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$LocalAlbumAssetEntityTable, - i1.LocalAlbumAssetEntityData, - i1.$$LocalAlbumAssetEntityTableFilterComposer, - i1.$$LocalAlbumAssetEntityTableOrderingComposer, - i1.$$LocalAlbumAssetEntityTableAnnotationComposer, - $$LocalAlbumAssetEntityTableCreateCompanionBuilder, - $$LocalAlbumAssetEntityTableUpdateCompanionBuilder, - ( - i1.LocalAlbumAssetEntityData, - i1.$$LocalAlbumAssetEntityTableReferences, - ), - i1.LocalAlbumAssetEntityData, - i0.PrefetchHooks Function({bool assetId, bool albumId}) - > { - $$LocalAlbumAssetEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$LocalAlbumAssetEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$LocalAlbumAssetEntityTableFilterComposer( - $db: db, - $table: table, - ), - createOrderingComposer: () => - i1.$$LocalAlbumAssetEntityTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - i1.$$LocalAlbumAssetEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value assetId = const i0.Value.absent(), - i0.Value albumId = const i0.Value.absent(), - i0.Value marker_ = const i0.Value.absent(), - }) => i1.LocalAlbumAssetEntityCompanion( - assetId: assetId, - albumId: albumId, - marker_: marker_, - ), - createCompanionCallback: - ({ - required String assetId, - required String albumId, - i0.Value marker_ = const i0.Value.absent(), - }) => i1.LocalAlbumAssetEntityCompanion.insert( - assetId: assetId, - albumId: albumId, - marker_: marker_, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$LocalAlbumAssetEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false, albumId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$LocalAlbumAssetEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$LocalAlbumAssetEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - if (albumId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.albumId, - referencedTable: i1 - .$$LocalAlbumAssetEntityTableReferences - ._albumIdTable(db), - referencedColumn: i1 - .$$LocalAlbumAssetEntityTableReferences - ._albumIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$LocalAlbumAssetEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$LocalAlbumAssetEntityTable, - i1.LocalAlbumAssetEntityData, - i1.$$LocalAlbumAssetEntityTableFilterComposer, - i1.$$LocalAlbumAssetEntityTableOrderingComposer, - i1.$$LocalAlbumAssetEntityTableAnnotationComposer, - $$LocalAlbumAssetEntityTableCreateCompanionBuilder, - $$LocalAlbumAssetEntityTableUpdateCompanionBuilder, - (i1.LocalAlbumAssetEntityData, i1.$$LocalAlbumAssetEntityTableReferences), - i1.LocalAlbumAssetEntityData, - i0.PrefetchHooks Function({bool assetId, bool albumId}) - >; -i0.Index get idxLocalAlbumAssetAlbumAsset => i0.Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', -); - -class $LocalAlbumAssetEntityTable extends i2.LocalAlbumAssetEntity - with - i0.TableInfo< - $LocalAlbumAssetEntityTable, - i1.LocalAlbumAssetEntityData - > { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $LocalAlbumAssetEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta( - 'albumId', - ); - @override - late final i0.GeneratedColumn albumId = i0.GeneratedColumn( - 'album_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _marker_Meta = const i0.VerificationMeta( - 'marker_', - ); - @override - late final i0.GeneratedColumn marker_ = i0.GeneratedColumn( - 'marker', - aliasedName, - true, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('album_id')) { - context.handle( - _albumIdMeta, - albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta), - ); - } else if (isInserting) { - context.missing(_albumIdMeta); - } - if (data.containsKey('marker')) { - context.handle( - _marker_Meta, - marker_.isAcceptableOrUnknown(data['marker']!, _marker_Meta), - ); - } - return context; - } - - @override - Set get $primaryKey => {assetId, albumId}; - @override - i1.LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - $LocalAlbumAssetEntityTable createAlias(String alias) { - return $LocalAlbumAssetEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends i0.DataClass - implements i0.Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = i0.Variable(assetId); - map['album_id'] = i0.Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = i0.Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - i1.LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - i0.Value marker_ = const i0.Value.absent(), - }) => i1.LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - i1.LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends i0.UpdateCompanion { - final i0.Value assetId; - final i0.Value albumId; - final i0.Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const i0.Value.absent(), - this.albumId = const i0.Value.absent(), - this.marker_ = const i0.Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const i0.Value.absent(), - }) : assetId = i0.Value(assetId), - albumId = i0.Value(albumId); - static i0.Insertable custom({ - i0.Expression? assetId, - i0.Expression? albumId, - i0.Expression? marker_, - }) { - return i0.RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - i1.LocalAlbumAssetEntityCompanion copyWith({ - i0.Value? assetId, - i0.Value? albumId, - i0.Value? marker_, - }) { - return i1.LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = i0.Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = i0.Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/local_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/local_asset.entity.drift.dart deleted file mode 100644 index fe03f9b208..0000000000 --- a/mobile/lib/infrastructure/entities/local_asset.entity.drift.dart +++ /dev/null @@ -1,1354 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/local_asset.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/asset/base_asset.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/local_asset.entity.dart' - as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; - -typedef $$LocalAssetEntityTableCreateCompanionBuilder = - i1.LocalAssetEntityCompanion Function({ - required String name, - required i2.AssetType type, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value width, - i0.Value height, - i0.Value durationMs, - required String id, - i0.Value checksum, - i0.Value isFavorite, - i0.Value orientation, - i0.Value iCloudId, - i0.Value adjustmentTime, - i0.Value latitude, - i0.Value longitude, - i0.Value playbackStyle, - }); -typedef $$LocalAssetEntityTableUpdateCompanionBuilder = - i1.LocalAssetEntityCompanion Function({ - i0.Value name, - i0.Value type, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value width, - i0.Value height, - i0.Value durationMs, - i0.Value id, - i0.Value checksum, - i0.Value isFavorite, - i0.Value orientation, - i0.Value iCloudId, - i0.Value adjustmentTime, - i0.Value latitude, - i0.Value longitude, - i0.Value playbackStyle, - }); - -class $$LocalAssetEntityTableFilterComposer - extends i0.Composer { - $$LocalAssetEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters get type => - $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get checksum => $composableBuilder( - column: $table.checksum, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get iCloudId => $composableBuilder( - column: $table.iCloudId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get adjustmentTime => $composableBuilder( - column: $table.adjustmentTime, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get latitude => $composableBuilder( - column: $table.latitude, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get longitude => $composableBuilder( - column: $table.longitude, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters< - i2.AssetPlaybackStyle, - i2.AssetPlaybackStyle, - int - > - get playbackStyle => $composableBuilder( - column: $table.playbackStyle, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); -} - -class $$LocalAssetEntityTableOrderingComposer - extends i0.Composer { - $$LocalAssetEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get type => $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get checksum => $composableBuilder( - column: $table.checksum, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get iCloudId => $composableBuilder( - column: $table.iCloudId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get adjustmentTime => $composableBuilder( - column: $table.adjustmentTime, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get latitude => $composableBuilder( - column: $table.latitude, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get longitude => $composableBuilder( - column: $table.longitude, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get playbackStyle => $composableBuilder( - column: $table.playbackStyle, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$LocalAssetEntityTableAnnotationComposer - extends i0.Composer { - $$LocalAssetEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter get type => - $composableBuilder(column: $table.type, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get width => - $composableBuilder(column: $table.width, builder: (column) => column); - - i0.GeneratedColumn get height => - $composableBuilder(column: $table.height, builder: (column) => column); - - i0.GeneratedColumn get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => column, - ); - - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get checksum => - $composableBuilder(column: $table.checksum, builder: (column) => column); - - i0.GeneratedColumn get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => column, - ); - - i0.GeneratedColumn get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => column, - ); - - i0.GeneratedColumn get iCloudId => - $composableBuilder(column: $table.iCloudId, builder: (column) => column); - - i0.GeneratedColumn get adjustmentTime => $composableBuilder( - column: $table.adjustmentTime, - builder: (column) => column, - ); - - i0.GeneratedColumn get latitude => - $composableBuilder(column: $table.latitude, builder: (column) => column); - - i0.GeneratedColumn get longitude => - $composableBuilder(column: $table.longitude, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter - get playbackStyle => $composableBuilder( - column: $table.playbackStyle, - builder: (column) => column, - ); -} - -class $$LocalAssetEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$LocalAssetEntityTable, - i1.LocalAssetEntityData, - i1.$$LocalAssetEntityTableFilterComposer, - i1.$$LocalAssetEntityTableOrderingComposer, - i1.$$LocalAssetEntityTableAnnotationComposer, - $$LocalAssetEntityTableCreateCompanionBuilder, - $$LocalAssetEntityTableUpdateCompanionBuilder, - ( - i1.LocalAssetEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$LocalAssetEntityTable, - i1.LocalAssetEntityData - >, - ), - i1.LocalAssetEntityData, - i0.PrefetchHooks Function() - > { - $$LocalAssetEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$LocalAssetEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$LocalAssetEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$LocalAssetEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$LocalAssetEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value name = const i0.Value.absent(), - i0.Value type = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - i0.Value id = const i0.Value.absent(), - i0.Value checksum = const i0.Value.absent(), - i0.Value isFavorite = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - i0.Value iCloudId = const i0.Value.absent(), - i0.Value adjustmentTime = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - i0.Value playbackStyle = - const i0.Value.absent(), - }) => i1.LocalAssetEntityCompanion( - name: name, - type: type, - createdAt: createdAt, - updatedAt: updatedAt, - width: width, - height: height, - durationMs: durationMs, - id: id, - checksum: checksum, - isFavorite: isFavorite, - orientation: orientation, - iCloudId: iCloudId, - adjustmentTime: adjustmentTime, - latitude: latitude, - longitude: longitude, - playbackStyle: playbackStyle, - ), - createCompanionCallback: - ({ - required String name, - required i2.AssetType type, - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - required String id, - i0.Value checksum = const i0.Value.absent(), - i0.Value isFavorite = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - i0.Value iCloudId = const i0.Value.absent(), - i0.Value adjustmentTime = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - i0.Value playbackStyle = - const i0.Value.absent(), - }) => i1.LocalAssetEntityCompanion.insert( - name: name, - type: type, - createdAt: createdAt, - updatedAt: updatedAt, - width: width, - height: height, - durationMs: durationMs, - id: id, - checksum: checksum, - isFavorite: isFavorite, - orientation: orientation, - iCloudId: iCloudId, - adjustmentTime: adjustmentTime, - latitude: latitude, - longitude: longitude, - playbackStyle: playbackStyle, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$LocalAssetEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$LocalAssetEntityTable, - i1.LocalAssetEntityData, - i1.$$LocalAssetEntityTableFilterComposer, - i1.$$LocalAssetEntityTableOrderingComposer, - i1.$$LocalAssetEntityTableAnnotationComposer, - $$LocalAssetEntityTableCreateCompanionBuilder, - $$LocalAssetEntityTableUpdateCompanionBuilder, - ( - i1.LocalAssetEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$LocalAssetEntityTable, - i1.LocalAssetEntityData - >, - ), - i1.LocalAssetEntityData, - i0.PrefetchHooks Function() - >; -i0.Index get idxLocalAssetChecksum => i0.Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', -); - -class $LocalAssetEntityTable extends i3.LocalAssetEntity - with i0.TableInfo<$LocalAssetEntityTable, i1.LocalAssetEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $LocalAssetEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - late final i0.GeneratedColumnWithTypeConverter type = - i0.GeneratedColumn( - 'type', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter(i1.$LocalAssetEntityTable.$convertertype); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _widthMeta = const i0.VerificationMeta( - 'width', - ); - @override - late final i0.GeneratedColumn width = i0.GeneratedColumn( - 'width', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _heightMeta = const i0.VerificationMeta( - 'height', - ); - @override - late final i0.GeneratedColumn height = i0.GeneratedColumn( - 'height', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _durationMsMeta = const i0.VerificationMeta( - 'durationMs', - ); - @override - late final i0.GeneratedColumn durationMs = i0.GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _checksumMeta = const i0.VerificationMeta( - 'checksum', - ); - @override - late final i0.GeneratedColumn checksum = i0.GeneratedColumn( - 'checksum', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _isFavoriteMeta = const i0.VerificationMeta( - 'isFavorite', - ); - @override - late final i0.GeneratedColumn isFavorite = i0.GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _orientationMeta = const i0.VerificationMeta( - 'orientation', - ); - @override - late final i0.GeneratedColumn orientation = i0.GeneratedColumn( - 'orientation', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ); - static const i0.VerificationMeta _iCloudIdMeta = const i0.VerificationMeta( - 'iCloudId', - ); - @override - late final i0.GeneratedColumn iCloudId = i0.GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _adjustmentTimeMeta = - const i0.VerificationMeta('adjustmentTime'); - @override - late final i0.GeneratedColumn adjustmentTime = - i0.GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _latitudeMeta = const i0.VerificationMeta( - 'latitude', - ); - @override - late final i0.GeneratedColumn latitude = i0.GeneratedColumn( - 'latitude', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _longitudeMeta = const i0.VerificationMeta( - 'longitude', - ); - @override - late final i0.GeneratedColumn longitude = i0.GeneratedColumn( - 'longitude', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - late final i0.GeneratedColumnWithTypeConverter - playbackStyle = - i0.GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ).withConverter( - i1.$LocalAssetEntityTable.$converterplaybackStyle, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('width')) { - context.handle( - _widthMeta, - width.isAcceptableOrUnknown(data['width']!, _widthMeta), - ); - } - if (data.containsKey('height')) { - context.handle( - _heightMeta, - height.isAcceptableOrUnknown(data['height']!, _heightMeta), - ); - } - if (data.containsKey('duration_ms')) { - context.handle( - _durationMsMeta, - durationMs.isAcceptableOrUnknown(data['duration_ms']!, _durationMsMeta), - ); - } - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('checksum')) { - context.handle( - _checksumMeta, - checksum.isAcceptableOrUnknown(data['checksum']!, _checksumMeta), - ); - } - if (data.containsKey('is_favorite')) { - context.handle( - _isFavoriteMeta, - isFavorite.isAcceptableOrUnknown(data['is_favorite']!, _isFavoriteMeta), - ); - } - if (data.containsKey('orientation')) { - context.handle( - _orientationMeta, - orientation.isAcceptableOrUnknown( - data['orientation']!, - _orientationMeta, - ), - ); - } - if (data.containsKey('i_cloud_id')) { - context.handle( - _iCloudIdMeta, - iCloudId.isAcceptableOrUnknown(data['i_cloud_id']!, _iCloudIdMeta), - ); - } - if (data.containsKey('adjustment_time')) { - context.handle( - _adjustmentTimeMeta, - adjustmentTime.isAcceptableOrUnknown( - data['adjustment_time']!, - _adjustmentTimeMeta, - ), - ); - } - if (data.containsKey('latitude')) { - context.handle( - _latitudeMeta, - latitude.isAcceptableOrUnknown(data['latitude']!, _latitudeMeta), - ); - } - if (data.containsKey('longitude')) { - context.handle( - _longitudeMeta, - longitude.isAcceptableOrUnknown(data['longitude']!, _longitudeMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.LocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: i1.$LocalAssetEntityTable.$convertertype.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - ), - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: i1.$LocalAssetEntityTable.$converterplaybackStyle.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ), - ); - } - - @override - $LocalAssetEntityTable createAlias(String alias) { - return $LocalAssetEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $convertertype = - const i0.EnumIndexConverter(i2.AssetType.values); - static i0.JsonTypeConverter2 - $converterplaybackStyle = const i0.EnumIndexConverter( - i2.AssetPlaybackStyle.values, - ); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends i0.DataClass - implements i0.Insertable { - final String name; - final i2.AssetType type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - final i2.AssetPlaybackStyle playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = i0.Variable(name); - { - map['type'] = i0.Variable( - i1.$LocalAssetEntityTable.$convertertype.toSql(type), - ); - } - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = i0.Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = i0.Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = i0.Variable(durationMs); - } - map['id'] = i0.Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = i0.Variable(checksum); - } - map['is_favorite'] = i0.Variable(isFavorite); - map['orientation'] = i0.Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = i0.Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = i0.Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = i0.Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = i0.Variable(longitude); - } - { - map['playback_style'] = i0.Variable( - i1.$LocalAssetEntityTable.$converterplaybackStyle.toSql(playbackStyle), - ); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: i1.$LocalAssetEntityTable.$convertertype.fromJson( - serializer.fromJson(json['type']), - ), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: i1.$LocalAssetEntityTable.$converterplaybackStyle.fromJson( - serializer.fromJson(json['playbackStyle']), - ), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson( - i1.$LocalAssetEntityTable.$convertertype.toJson(type), - ), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson( - i1.$LocalAssetEntityTable.$converterplaybackStyle.toJson(playbackStyle), - ), - }; - } - - i1.LocalAssetEntityData copyWith({ - String? name, - i2.AssetType? type, - DateTime? createdAt, - DateTime? updatedAt, - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - String? id, - i0.Value checksum = const i0.Value.absent(), - bool? isFavorite, - int? orientation, - i0.Value iCloudId = const i0.Value.absent(), - i0.Value adjustmentTime = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - i2.AssetPlaybackStyle? playbackStyle, - }) => i1.LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(i1.LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion - extends i0.UpdateCompanion { - final i0.Value name; - final i0.Value type; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value width; - final i0.Value height; - final i0.Value durationMs; - final i0.Value id; - final i0.Value checksum; - final i0.Value isFavorite; - final i0.Value orientation; - final i0.Value iCloudId; - final i0.Value adjustmentTime; - final i0.Value latitude; - final i0.Value longitude; - final i0.Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const i0.Value.absent(), - this.type = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.durationMs = const i0.Value.absent(), - this.id = const i0.Value.absent(), - this.checksum = const i0.Value.absent(), - this.isFavorite = const i0.Value.absent(), - this.orientation = const i0.Value.absent(), - this.iCloudId = const i0.Value.absent(), - this.adjustmentTime = const i0.Value.absent(), - this.latitude = const i0.Value.absent(), - this.longitude = const i0.Value.absent(), - this.playbackStyle = const i0.Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required i2.AssetType type, - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.durationMs = const i0.Value.absent(), - required String id, - this.checksum = const i0.Value.absent(), - this.isFavorite = const i0.Value.absent(), - this.orientation = const i0.Value.absent(), - this.iCloudId = const i0.Value.absent(), - this.adjustmentTime = const i0.Value.absent(), - this.latitude = const i0.Value.absent(), - this.longitude = const i0.Value.absent(), - this.playbackStyle = const i0.Value.absent(), - }) : name = i0.Value(name), - type = i0.Value(type), - id = i0.Value(id); - static i0.Insertable custom({ - i0.Expression? name, - i0.Expression? type, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? width, - i0.Expression? height, - i0.Expression? durationMs, - i0.Expression? id, - i0.Expression? checksum, - i0.Expression? isFavorite, - i0.Expression? orientation, - i0.Expression? iCloudId, - i0.Expression? adjustmentTime, - i0.Expression? latitude, - i0.Expression? longitude, - i0.Expression? playbackStyle, - }) { - return i0.RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - i1.LocalAssetEntityCompanion copyWith({ - i0.Value? name, - i0.Value? type, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? width, - i0.Value? height, - i0.Value? durationMs, - i0.Value? id, - i0.Value? checksum, - i0.Value? isFavorite, - i0.Value? orientation, - i0.Value? iCloudId, - i0.Value? adjustmentTime, - i0.Value? latitude, - i0.Value? longitude, - i0.Value? playbackStyle, - }) { - return i1.LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (type.present) { - map['type'] = i0.Variable( - i1.$LocalAssetEntityTable.$convertertype.toSql(type.value), - ); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (width.present) { - map['width'] = i0.Variable(width.value); - } - if (height.present) { - map['height'] = i0.Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = i0.Variable(durationMs.value); - } - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (checksum.present) { - map['checksum'] = i0.Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = i0.Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = i0.Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = i0.Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = i0.Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = i0.Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = i0.Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = i0.Variable( - i1.$LocalAssetEntityTable.$converterplaybackStyle.toSql( - playbackStyle.value, - ), - ); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -i0.Index get idxLocalAssetCloudId => i0.Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', -); -i0.Index get idxLocalAssetCreatedAt => i0.Index( - 'idx_local_asset_created_at', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_created_at ON local_asset_entity (created_at)', -); diff --git a/mobile/lib/infrastructure/entities/log.entity.drift.dart b/mobile/lib/infrastructure/entities/log.entity.drift.dart deleted file mode 100644 index d04cd5b7a2..0000000000 --- a/mobile/lib/infrastructure/entities/log.entity.drift.dart +++ /dev/null @@ -1,697 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/log.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/log.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/log.entity.dart' as i3; - -typedef $$LogMessageEntityTableCreateCompanionBuilder = - i1.LogMessageEntityCompanion Function({ - i0.Value id, - required String message, - i0.Value details, - required i2.LogLevel level, - required DateTime createdAt, - i0.Value logger, - i0.Value stack, - }); -typedef $$LogMessageEntityTableUpdateCompanionBuilder = - i1.LogMessageEntityCompanion Function({ - i0.Value id, - i0.Value message, - i0.Value details, - i0.Value level, - i0.Value createdAt, - i0.Value logger, - i0.Value stack, - }); - -class $$LogMessageEntityTableFilterComposer - extends i0.Composer { - $$LogMessageEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get message => $composableBuilder( - column: $table.message, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get details => $composableBuilder( - column: $table.details, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters get level => - $composableBuilder( - column: $table.level, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get logger => $composableBuilder( - column: $table.logger, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get stack => $composableBuilder( - column: $table.stack, - builder: (column) => i0.ColumnFilters(column), - ); -} - -class $$LogMessageEntityTableOrderingComposer - extends i0.Composer { - $$LogMessageEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get message => $composableBuilder( - column: $table.message, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get details => $composableBuilder( - column: $table.details, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get level => $composableBuilder( - column: $table.level, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get logger => $composableBuilder( - column: $table.logger, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get stack => $composableBuilder( - column: $table.stack, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$LogMessageEntityTableAnnotationComposer - extends i0.Composer { - $$LogMessageEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get message => - $composableBuilder(column: $table.message, builder: (column) => column); - - i0.GeneratedColumn get details => - $composableBuilder(column: $table.details, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter get level => - $composableBuilder(column: $table.level, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get logger => - $composableBuilder(column: $table.logger, builder: (column) => column); - - i0.GeneratedColumn get stack => - $composableBuilder(column: $table.stack, builder: (column) => column); -} - -class $$LogMessageEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$LogMessageEntityTable, - i1.LogMessageEntityData, - i1.$$LogMessageEntityTableFilterComposer, - i1.$$LogMessageEntityTableOrderingComposer, - i1.$$LogMessageEntityTableAnnotationComposer, - $$LogMessageEntityTableCreateCompanionBuilder, - $$LogMessageEntityTableUpdateCompanionBuilder, - ( - i1.LogMessageEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$LogMessageEntityTable, - i1.LogMessageEntityData - >, - ), - i1.LogMessageEntityData, - i0.PrefetchHooks Function() - > { - $$LogMessageEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$LogMessageEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$LogMessageEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$LogMessageEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$LogMessageEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value message = const i0.Value.absent(), - i0.Value details = const i0.Value.absent(), - i0.Value level = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value logger = const i0.Value.absent(), - i0.Value stack = const i0.Value.absent(), - }) => i1.LogMessageEntityCompanion( - id: id, - message: message, - details: details, - level: level, - createdAt: createdAt, - logger: logger, - stack: stack, - ), - createCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - required String message, - i0.Value details = const i0.Value.absent(), - required i2.LogLevel level, - required DateTime createdAt, - i0.Value logger = const i0.Value.absent(), - i0.Value stack = const i0.Value.absent(), - }) => i1.LogMessageEntityCompanion.insert( - id: id, - message: message, - details: details, - level: level, - createdAt: createdAt, - logger: logger, - stack: stack, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$LogMessageEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$LogMessageEntityTable, - i1.LogMessageEntityData, - i1.$$LogMessageEntityTableFilterComposer, - i1.$$LogMessageEntityTableOrderingComposer, - i1.$$LogMessageEntityTableAnnotationComposer, - $$LogMessageEntityTableCreateCompanionBuilder, - $$LogMessageEntityTableUpdateCompanionBuilder, - ( - i1.LogMessageEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$LogMessageEntityTable, - i1.LogMessageEntityData - >, - ), - i1.LogMessageEntityData, - i0.PrefetchHooks Function() - >; - -class $LogMessageEntityTable extends i3.LogMessageEntity - with i0.TableInfo<$LogMessageEntityTable, i1.LogMessageEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $LogMessageEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - hasAutoIncrement: true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'PRIMARY KEY AUTOINCREMENT', - ), - ); - static const i0.VerificationMeta _messageMeta = const i0.VerificationMeta( - 'message', - ); - @override - late final i0.GeneratedColumn message = i0.GeneratedColumn( - 'message', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _detailsMeta = const i0.VerificationMeta( - 'details', - ); - @override - late final i0.GeneratedColumn details = i0.GeneratedColumn( - 'details', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - late final i0.GeneratedColumnWithTypeConverter level = - i0.GeneratedColumn( - 'level', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter(i1.$LogMessageEntityTable.$converterlevel); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _loggerMeta = const i0.VerificationMeta( - 'logger', - ); - @override - late final i0.GeneratedColumn logger = i0.GeneratedColumn( - 'logger', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _stackMeta = const i0.VerificationMeta( - 'stack', - ); - @override - late final i0.GeneratedColumn stack = i0.GeneratedColumn( - 'stack', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - message, - details, - level, - createdAt, - logger, - stack, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'logger_messages'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } - if (data.containsKey('message')) { - context.handle( - _messageMeta, - message.isAcceptableOrUnknown(data['message']!, _messageMeta), - ); - } else if (isInserting) { - context.missing(_messageMeta); - } - if (data.containsKey('details')) { - context.handle( - _detailsMeta, - details.isAcceptableOrUnknown(data['details']!, _detailsMeta), - ); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } else if (isInserting) { - context.missing(_createdAtMeta); - } - if (data.containsKey('logger')) { - context.handle( - _loggerMeta, - logger.isAcceptableOrUnknown(data['logger']!, _loggerMeta), - ); - } - if (data.containsKey('stack')) { - context.handle( - _stackMeta, - stack.isAcceptableOrUnknown(data['stack']!, _stackMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.LogMessageEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.LogMessageEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - message: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}message'], - )!, - details: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}details'], - ), - level: i1.$LogMessageEntityTable.$converterlevel.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}level'], - )!, - ), - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - logger: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}logger'], - ), - stack: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}stack'], - ), - ); - } - - @override - $LogMessageEntityTable createAlias(String alias) { - return $LogMessageEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converterlevel = - const i0.EnumIndexConverter(i2.LogLevel.values); -} - -class LogMessageEntityData extends i0.DataClass - implements i0.Insertable { - final int id; - final String message; - final String? details; - final i2.LogLevel level; - final DateTime createdAt; - final String? logger; - final String? stack; - const LogMessageEntityData({ - required this.id, - required this.message, - this.details, - required this.level, - required this.createdAt, - this.logger, - this.stack, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['message'] = i0.Variable(message); - if (!nullToAbsent || details != null) { - map['details'] = i0.Variable(details); - } - { - map['level'] = i0.Variable( - i1.$LogMessageEntityTable.$converterlevel.toSql(level), - ); - } - map['created_at'] = i0.Variable(createdAt); - if (!nullToAbsent || logger != null) { - map['logger'] = i0.Variable(logger); - } - if (!nullToAbsent || stack != null) { - map['stack'] = i0.Variable(stack); - } - return map; - } - - factory LogMessageEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return LogMessageEntityData( - id: serializer.fromJson(json['id']), - message: serializer.fromJson(json['message']), - details: serializer.fromJson(json['details']), - level: i1.$LogMessageEntityTable.$converterlevel.fromJson( - serializer.fromJson(json['level']), - ), - createdAt: serializer.fromJson(json['createdAt']), - logger: serializer.fromJson(json['logger']), - stack: serializer.fromJson(json['stack']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'message': serializer.toJson(message), - 'details': serializer.toJson(details), - 'level': serializer.toJson( - i1.$LogMessageEntityTable.$converterlevel.toJson(level), - ), - 'createdAt': serializer.toJson(createdAt), - 'logger': serializer.toJson(logger), - 'stack': serializer.toJson(stack), - }; - } - - i1.LogMessageEntityData copyWith({ - int? id, - String? message, - i0.Value details = const i0.Value.absent(), - i2.LogLevel? level, - DateTime? createdAt, - i0.Value logger = const i0.Value.absent(), - i0.Value stack = const i0.Value.absent(), - }) => i1.LogMessageEntityData( - id: id ?? this.id, - message: message ?? this.message, - details: details.present ? details.value : this.details, - level: level ?? this.level, - createdAt: createdAt ?? this.createdAt, - logger: logger.present ? logger.value : this.logger, - stack: stack.present ? stack.value : this.stack, - ); - LogMessageEntityData copyWithCompanion(i1.LogMessageEntityCompanion data) { - return LogMessageEntityData( - id: data.id.present ? data.id.value : this.id, - message: data.message.present ? data.message.value : this.message, - details: data.details.present ? data.details.value : this.details, - level: data.level.present ? data.level.value : this.level, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - logger: data.logger.present ? data.logger.value : this.logger, - stack: data.stack.present ? data.stack.value : this.stack, - ); - } - - @override - String toString() { - return (StringBuffer('LogMessageEntityData(') - ..write('id: $id, ') - ..write('message: $message, ') - ..write('details: $details, ') - ..write('level: $level, ') - ..write('createdAt: $createdAt, ') - ..write('logger: $logger, ') - ..write('stack: $stack') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, message, details, level, createdAt, logger, stack); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.LogMessageEntityData && - other.id == this.id && - other.message == this.message && - other.details == this.details && - other.level == this.level && - other.createdAt == this.createdAt && - other.logger == this.logger && - other.stack == this.stack); -} - -class LogMessageEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value message; - final i0.Value details; - final i0.Value level; - final i0.Value createdAt; - final i0.Value logger; - final i0.Value stack; - const LogMessageEntityCompanion({ - this.id = const i0.Value.absent(), - this.message = const i0.Value.absent(), - this.details = const i0.Value.absent(), - this.level = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.logger = const i0.Value.absent(), - this.stack = const i0.Value.absent(), - }); - LogMessageEntityCompanion.insert({ - this.id = const i0.Value.absent(), - required String message, - this.details = const i0.Value.absent(), - required i2.LogLevel level, - required DateTime createdAt, - this.logger = const i0.Value.absent(), - this.stack = const i0.Value.absent(), - }) : message = i0.Value(message), - level = i0.Value(level), - createdAt = i0.Value(createdAt); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? message, - i0.Expression? details, - i0.Expression? level, - i0.Expression? createdAt, - i0.Expression? logger, - i0.Expression? stack, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (message != null) 'message': message, - if (details != null) 'details': details, - if (level != null) 'level': level, - if (createdAt != null) 'created_at': createdAt, - if (logger != null) 'logger': logger, - if (stack != null) 'stack': stack, - }); - } - - i1.LogMessageEntityCompanion copyWith({ - i0.Value? id, - i0.Value? message, - i0.Value? details, - i0.Value? level, - i0.Value? createdAt, - i0.Value? logger, - i0.Value? stack, - }) { - return i1.LogMessageEntityCompanion( - id: id ?? this.id, - message: message ?? this.message, - details: details ?? this.details, - level: level ?? this.level, - createdAt: createdAt ?? this.createdAt, - logger: logger ?? this.logger, - stack: stack ?? this.stack, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (message.present) { - map['message'] = i0.Variable(message.value); - } - if (details.present) { - map['details'] = i0.Variable(details.value); - } - if (level.present) { - map['level'] = i0.Variable( - i1.$LogMessageEntityTable.$converterlevel.toSql(level.value), - ); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (logger.present) { - map['logger'] = i0.Variable(logger.value); - } - if (stack.present) { - map['stack'] = i0.Variable(stack.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LogMessageEntityCompanion(') - ..write('id: $id, ') - ..write('message: $message, ') - ..write('details: $details, ') - ..write('level: $level, ') - ..write('createdAt: $createdAt, ') - ..write('logger: $logger, ') - ..write('stack: $stack') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/memory.entity.drift.dart b/mobile/lib/infrastructure/entities/memory.entity.drift.dart deleted file mode 100644 index 67da03509a..0000000000 --- a/mobile/lib/infrastructure/entities/memory.entity.drift.dart +++ /dev/null @@ -1,1170 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/memory.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/memory.entity.dart' as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i5; -import 'package:drift/internal/modular.dart' as i6; - -typedef $$MemoryEntityTableCreateCompanionBuilder = - i1.MemoryEntityCompanion Function({ - required String id, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value deletedAt, - required String ownerId, - required i2.MemoryTypeEnum type, - required String data, - i0.Value isSaved, - required DateTime memoryAt, - i0.Value seenAt, - i0.Value showAt, - i0.Value hideAt, - }); -typedef $$MemoryEntityTableUpdateCompanionBuilder = - i1.MemoryEntityCompanion Function({ - i0.Value id, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value deletedAt, - i0.Value ownerId, - i0.Value type, - i0.Value data, - i0.Value isSaved, - i0.Value memoryAt, - i0.Value seenAt, - i0.Value showAt, - i0.Value hideAt, - }); - -final class $$MemoryEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$MemoryEntityTable, - i1.MemoryEntityData - > { - $$MemoryEntityTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static i5.$UserEntityTable _ownerIdTable(i0.GeneratedDatabase db) => - i6.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('memory_entity__owner_id__user_entity__id'); - - i5.$$UserEntityTableProcessedTableManager get ownerId { - final $_column = $_itemColumn('owner_id')!; - - final manager = i5 - .$$UserEntityTableTableManager( - $_db, - i6.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_ownerIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$MemoryEntityTableFilterComposer - extends i0.Composer { - $$MemoryEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get deletedAt => $composableBuilder( - column: $table.deletedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get type => $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get data => $composableBuilder( - column: $table.data, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isSaved => $composableBuilder( - column: $table.isSaved, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get memoryAt => $composableBuilder( - column: $table.memoryAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get seenAt => $composableBuilder( - column: $table.seenAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get showAt => $composableBuilder( - column: $table.showAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get hideAt => $composableBuilder( - column: $table.hideAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i5.$$UserEntityTableFilterComposer get ownerId { - final i5.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableFilterComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$MemoryEntityTableOrderingComposer - extends i0.Composer { - $$MemoryEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get deletedAt => $composableBuilder( - column: $table.deletedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get type => $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get data => $composableBuilder( - column: $table.data, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isSaved => $composableBuilder( - column: $table.isSaved, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get memoryAt => $composableBuilder( - column: $table.memoryAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get seenAt => $composableBuilder( - column: $table.seenAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get showAt => $composableBuilder( - column: $table.showAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get hideAt => $composableBuilder( - column: $table.hideAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i5.$$UserEntityTableOrderingComposer get ownerId { - final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$MemoryEntityTableAnnotationComposer - extends i0.Composer { - $$MemoryEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get deletedAt => - $composableBuilder(column: $table.deletedAt, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter get type => - $composableBuilder(column: $table.type, builder: (column) => column); - - i0.GeneratedColumn get data => - $composableBuilder(column: $table.data, builder: (column) => column); - - i0.GeneratedColumn get isSaved => - $composableBuilder(column: $table.isSaved, builder: (column) => column); - - i0.GeneratedColumn get memoryAt => - $composableBuilder(column: $table.memoryAt, builder: (column) => column); - - i0.GeneratedColumn get seenAt => - $composableBuilder(column: $table.seenAt, builder: (column) => column); - - i0.GeneratedColumn get showAt => - $composableBuilder(column: $table.showAt, builder: (column) => column); - - i0.GeneratedColumn get hideAt => - $composableBuilder(column: $table.hideAt, builder: (column) => column); - - i5.$$UserEntityTableAnnotationComposer get ownerId { - final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$MemoryEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$MemoryEntityTable, - i1.MemoryEntityData, - i1.$$MemoryEntityTableFilterComposer, - i1.$$MemoryEntityTableOrderingComposer, - i1.$$MemoryEntityTableAnnotationComposer, - $$MemoryEntityTableCreateCompanionBuilder, - $$MemoryEntityTableUpdateCompanionBuilder, - (i1.MemoryEntityData, i1.$$MemoryEntityTableReferences), - i1.MemoryEntityData, - i0.PrefetchHooks Function({bool ownerId}) - > { - $$MemoryEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$MemoryEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$MemoryEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$MemoryEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$MemoryEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - i0.Value ownerId = const i0.Value.absent(), - i0.Value type = const i0.Value.absent(), - i0.Value data = const i0.Value.absent(), - i0.Value isSaved = const i0.Value.absent(), - i0.Value memoryAt = const i0.Value.absent(), - i0.Value seenAt = const i0.Value.absent(), - i0.Value showAt = const i0.Value.absent(), - i0.Value hideAt = const i0.Value.absent(), - }) => i1.MemoryEntityCompanion( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - deletedAt: deletedAt, - ownerId: ownerId, - type: type, - data: data, - isSaved: isSaved, - memoryAt: memoryAt, - seenAt: seenAt, - showAt: showAt, - hideAt: hideAt, - ), - createCompanionCallback: - ({ - required String id, - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - required String ownerId, - required i2.MemoryTypeEnum type, - required String data, - i0.Value isSaved = const i0.Value.absent(), - required DateTime memoryAt, - i0.Value seenAt = const i0.Value.absent(), - i0.Value showAt = const i0.Value.absent(), - i0.Value hideAt = const i0.Value.absent(), - }) => i1.MemoryEntityCompanion.insert( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - deletedAt: deletedAt, - ownerId: ownerId, - type: type, - data: data, - isSaved: isSaved, - memoryAt: memoryAt, - seenAt: seenAt, - showAt: showAt, - hideAt: hideAt, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$MemoryEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({ownerId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (ownerId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.ownerId, - referencedTable: i1 - .$$MemoryEntityTableReferences - ._ownerIdTable(db), - referencedColumn: i1 - .$$MemoryEntityTableReferences - ._ownerIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$MemoryEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$MemoryEntityTable, - i1.MemoryEntityData, - i1.$$MemoryEntityTableFilterComposer, - i1.$$MemoryEntityTableOrderingComposer, - i1.$$MemoryEntityTableAnnotationComposer, - $$MemoryEntityTableCreateCompanionBuilder, - $$MemoryEntityTableUpdateCompanionBuilder, - (i1.MemoryEntityData, i1.$$MemoryEntityTableReferences), - i1.MemoryEntityData, - i0.PrefetchHooks Function({bool ownerId}) - >; - -class $MemoryEntityTable extends i3.MemoryEntity - with i0.TableInfo<$MemoryEntityTable, i1.MemoryEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $MemoryEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _deletedAtMeta = const i0.VerificationMeta( - 'deletedAt', - ); - @override - late final i0.GeneratedColumn deletedAt = - i0.GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _ownerIdMeta = const i0.VerificationMeta( - 'ownerId', - ); - @override - late final i0.GeneratedColumn ownerId = i0.GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - @override - late final i0.GeneratedColumnWithTypeConverter type = - i0.GeneratedColumn( - 'type', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter(i1.$MemoryEntityTable.$convertertype); - static const i0.VerificationMeta _dataMeta = const i0.VerificationMeta( - 'data', - ); - @override - late final i0.GeneratedColumn data = i0.GeneratedColumn( - 'data', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _isSavedMeta = const i0.VerificationMeta( - 'isSaved', - ); - @override - late final i0.GeneratedColumn isSaved = i0.GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _memoryAtMeta = const i0.VerificationMeta( - 'memoryAt', - ); - @override - late final i0.GeneratedColumn memoryAt = - i0.GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _seenAtMeta = const i0.VerificationMeta( - 'seenAt', - ); - @override - late final i0.GeneratedColumn seenAt = i0.GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _showAtMeta = const i0.VerificationMeta( - 'showAt', - ); - @override - late final i0.GeneratedColumn showAt = i0.GeneratedColumn( - 'show_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _hideAtMeta = const i0.VerificationMeta( - 'hideAt', - ); - @override - late final i0.GeneratedColumn hideAt = i0.GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('deleted_at')) { - context.handle( - _deletedAtMeta, - deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta), - ); - } - if (data.containsKey('owner_id')) { - context.handle( - _ownerIdMeta, - ownerId.isAcceptableOrUnknown(data['owner_id']!, _ownerIdMeta), - ); - } else if (isInserting) { - context.missing(_ownerIdMeta); - } - if (data.containsKey('data')) { - context.handle( - _dataMeta, - this.data.isAcceptableOrUnknown(data['data']!, _dataMeta), - ); - } else if (isInserting) { - context.missing(_dataMeta); - } - if (data.containsKey('is_saved')) { - context.handle( - _isSavedMeta, - isSaved.isAcceptableOrUnknown(data['is_saved']!, _isSavedMeta), - ); - } - if (data.containsKey('memory_at')) { - context.handle( - _memoryAtMeta, - memoryAt.isAcceptableOrUnknown(data['memory_at']!, _memoryAtMeta), - ); - } else if (isInserting) { - context.missing(_memoryAtMeta); - } - if (data.containsKey('seen_at')) { - context.handle( - _seenAtMeta, - seenAt.isAcceptableOrUnknown(data['seen_at']!, _seenAtMeta), - ); - } - if (data.containsKey('show_at')) { - context.handle( - _showAtMeta, - showAt.isAcceptableOrUnknown(data['show_at']!, _showAtMeta), - ); - } - if (data.containsKey('hide_at')) { - context.handle( - _hideAtMeta, - hideAt.isAcceptableOrUnknown(data['hide_at']!, _hideAtMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.MemoryEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: i1.$MemoryEntityTable.$convertertype.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - ), - data: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - $MemoryEntityTable createAlias(String alias) { - return $MemoryEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $convertertype = - const i0.EnumIndexConverter(i2.MemoryTypeEnum.values); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final i2.MemoryTypeEnum type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = i0.Variable(deletedAt); - } - map['owner_id'] = i0.Variable(ownerId); - { - map['type'] = i0.Variable( - i1.$MemoryEntityTable.$convertertype.toSql(type), - ); - } - map['data'] = i0.Variable(data); - map['is_saved'] = i0.Variable(isSaved); - map['memory_at'] = i0.Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = i0.Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = i0.Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = i0.Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: i1.$MemoryEntityTable.$convertertype.fromJson( - serializer.fromJson(json['type']), - ), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson( - i1.$MemoryEntityTable.$convertertype.toJson(type), - ), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - i1.MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - i0.Value deletedAt = const i0.Value.absent(), - String? ownerId, - i2.MemoryTypeEnum? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - i0.Value seenAt = const i0.Value.absent(), - i0.Value showAt = const i0.Value.absent(), - i0.Value hideAt = const i0.Value.absent(), - }) => i1.MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(i1.MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value deletedAt; - final i0.Value ownerId; - final i0.Value type; - final i0.Value data; - final i0.Value isSaved; - final i0.Value memoryAt; - final i0.Value seenAt; - final i0.Value showAt; - final i0.Value hideAt; - const MemoryEntityCompanion({ - this.id = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.deletedAt = const i0.Value.absent(), - this.ownerId = const i0.Value.absent(), - this.type = const i0.Value.absent(), - this.data = const i0.Value.absent(), - this.isSaved = const i0.Value.absent(), - this.memoryAt = const i0.Value.absent(), - this.seenAt = const i0.Value.absent(), - this.showAt = const i0.Value.absent(), - this.hideAt = const i0.Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.deletedAt = const i0.Value.absent(), - required String ownerId, - required i2.MemoryTypeEnum type, - required String data, - this.isSaved = const i0.Value.absent(), - required DateTime memoryAt, - this.seenAt = const i0.Value.absent(), - this.showAt = const i0.Value.absent(), - this.hideAt = const i0.Value.absent(), - }) : id = i0.Value(id), - ownerId = i0.Value(ownerId), - type = i0.Value(type), - data = i0.Value(data), - memoryAt = i0.Value(memoryAt); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? deletedAt, - i0.Expression? ownerId, - i0.Expression? type, - i0.Expression? data, - i0.Expression? isSaved, - i0.Expression? memoryAt, - i0.Expression? seenAt, - i0.Expression? showAt, - i0.Expression? hideAt, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - i1.MemoryEntityCompanion copyWith({ - i0.Value? id, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? deletedAt, - i0.Value? ownerId, - i0.Value? type, - i0.Value? data, - i0.Value? isSaved, - i0.Value? memoryAt, - i0.Value? seenAt, - i0.Value? showAt, - i0.Value? hideAt, - }) { - return i1.MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = i0.Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = i0.Variable(ownerId.value); - } - if (type.present) { - map['type'] = i0.Variable( - i1.$MemoryEntityTable.$convertertype.toSql(type.value), - ); - } - if (data.present) { - map['data'] = i0.Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = i0.Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = i0.Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = i0.Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = i0.Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = i0.Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/memory_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/memory_asset.entity.drift.dart deleted file mode 100644 index a42384ac76..0000000000 --- a/mobile/lib/infrastructure/entities/memory_asset.entity.drift.dart +++ /dev/null @@ -1,625 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/memory_asset.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/memory_asset.entity.dart' - as i2; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i3; -import 'package:drift/internal/modular.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart' - as i5; - -typedef $$MemoryAssetEntityTableCreateCompanionBuilder = - i1.MemoryAssetEntityCompanion Function({ - required String assetId, - required String memoryId, - }); -typedef $$MemoryAssetEntityTableUpdateCompanionBuilder = - i1.MemoryAssetEntityCompanion Function({ - i0.Value assetId, - i0.Value memoryId, - }); - -final class $$MemoryAssetEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$MemoryAssetEntityTable, - i1.MemoryAssetEntityData - > { - $$MemoryAssetEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias( - 'memory_asset_entity__asset_id__remote_asset_entity__id', - ); - - i3.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i3 - .$$RemoteAssetEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static i5.$MemoryEntityTable _memoryIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('memory_entity') - .createAlias('memory_asset_entity__memory_id__memory_entity__id'); - - i5.$$MemoryEntityTableProcessedTableManager get memoryId { - final $_column = $_itemColumn('memory_id')!; - - final manager = i5 - .$$MemoryEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('memory_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_memoryIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$MemoryAssetEntityTableFilterComposer - extends i0.Composer { - $$MemoryAssetEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i3.$$RemoteAssetEntityTableFilterComposer get assetId { - final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$MemoryEntityTableFilterComposer get memoryId { - final i5.$$MemoryEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.memoryId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('memory_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$MemoryEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('memory_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$MemoryAssetEntityTableOrderingComposer - extends i0.Composer { - $$MemoryAssetEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i3.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i3.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$MemoryEntityTableOrderingComposer get memoryId { - final i5.$$MemoryEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.memoryId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('memory_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$MemoryEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('memory_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$MemoryAssetEntityTableAnnotationComposer - extends i0.Composer { - $$MemoryAssetEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i3.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i3.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$MemoryEntityTableAnnotationComposer get memoryId { - final i5.$$MemoryEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.memoryId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('memory_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$MemoryEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('memory_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$MemoryAssetEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$MemoryAssetEntityTable, - i1.MemoryAssetEntityData, - i1.$$MemoryAssetEntityTableFilterComposer, - i1.$$MemoryAssetEntityTableOrderingComposer, - i1.$$MemoryAssetEntityTableAnnotationComposer, - $$MemoryAssetEntityTableCreateCompanionBuilder, - $$MemoryAssetEntityTableUpdateCompanionBuilder, - (i1.MemoryAssetEntityData, i1.$$MemoryAssetEntityTableReferences), - i1.MemoryAssetEntityData, - i0.PrefetchHooks Function({bool assetId, bool memoryId}) - > { - $$MemoryAssetEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$MemoryAssetEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$MemoryAssetEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$MemoryAssetEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$MemoryAssetEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value assetId = const i0.Value.absent(), - i0.Value memoryId = const i0.Value.absent(), - }) => i1.MemoryAssetEntityCompanion( - assetId: assetId, - memoryId: memoryId, - ), - createCompanionCallback: - ({required String assetId, required String memoryId}) => - i1.MemoryAssetEntityCompanion.insert( - assetId: assetId, - memoryId: memoryId, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$MemoryAssetEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false, memoryId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$MemoryAssetEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$MemoryAssetEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - if (memoryId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.memoryId, - referencedTable: i1 - .$$MemoryAssetEntityTableReferences - ._memoryIdTable(db), - referencedColumn: i1 - .$$MemoryAssetEntityTableReferences - ._memoryIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$MemoryAssetEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$MemoryAssetEntityTable, - i1.MemoryAssetEntityData, - i1.$$MemoryAssetEntityTableFilterComposer, - i1.$$MemoryAssetEntityTableOrderingComposer, - i1.$$MemoryAssetEntityTableAnnotationComposer, - $$MemoryAssetEntityTableCreateCompanionBuilder, - $$MemoryAssetEntityTableUpdateCompanionBuilder, - (i1.MemoryAssetEntityData, i1.$$MemoryAssetEntityTableReferences), - i1.MemoryAssetEntityData, - i0.PrefetchHooks Function({bool assetId, bool memoryId}) - >; - -class $MemoryAssetEntityTable extends i2.MemoryAssetEntity - with i0.TableInfo<$MemoryAssetEntityTable, i1.MemoryAssetEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $MemoryAssetEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _memoryIdMeta = const i0.VerificationMeta( - 'memoryId', - ); - @override - late final i0.GeneratedColumn memoryId = i0.GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('memory_id')) { - context.handle( - _memoryIdMeta, - memoryId.isAcceptableOrUnknown(data['memory_id']!, _memoryIdMeta), - ); - } else if (isInserting) { - context.missing(_memoryIdMeta); - } - return context; - } - - @override - Set get $primaryKey => {assetId, memoryId}; - @override - i1.MemoryAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - $MemoryAssetEntityTable createAlias(String alias) { - return $MemoryAssetEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends i0.DataClass - implements i0.Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = i0.Variable(assetId); - map['memory_id'] = i0.Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - i1.MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - i1.MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(i1.MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends i0.UpdateCompanion { - final i0.Value assetId; - final i0.Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const i0.Value.absent(), - this.memoryId = const i0.Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = i0.Value(assetId), - memoryId = i0.Value(memoryId); - static i0.Insertable custom({ - i0.Expression? assetId, - i0.Expression? memoryId, - }) { - return i0.RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - i1.MemoryAssetEntityCompanion copyWith({ - i0.Value? assetId, - i0.Value? memoryId, - }) { - return i1.MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = i0.Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/merged_asset.drift.dart b/mobile/lib/infrastructure/entities/merged_asset.drift.dart deleted file mode 100644 index 2d05ef6ceb..0000000000 --- a/mobile/lib/infrastructure/entities/merged_asset.drift.dart +++ /dev/null @@ -1,179 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:drift/internal/modular.dart' as i1; -import 'package:immich_mobile/domain/models/asset/base_asset.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/local_asset.entity.drift.dart' - as i3; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i4; -import 'package:immich_mobile/infrastructure/entities/stack.entity.drift.dart' - as i5; -import 'package:immich_mobile/infrastructure/entities/local_album_asset.entity.drift.dart' - as i6; -import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.dart' - as i7; - -class MergedAssetDrift extends i1.ModularAccessor { - MergedAssetDrift(i0.GeneratedDatabase db) : super(db); - i0.Selectable mergedAsset({ - required List userIds, - required MergedAsset$limit limit, - }) { - var $arrayStartIndex = 1; - final expandeduserIds = $expandVar($arrayStartIndex, userIds.length); - $arrayStartIndex += userIds.length; - final generatedlimit = $write( - limit(alias(this.localAssetEntity, 'lae')), - startIndex: $arrayStartIndex, - ); - $arrayStartIndex += generatedlimit.amountOfVariables; - return customSelect( - 'SELECT rae.id AS remote_id, (SELECT lae.id FROM local_asset_entity AS lae WHERE lae.checksum = rae.checksum LIMIT 1) AS local_id, rae.name, rae.type, rae.created_at AS created_at, rae.updated_at, rae.width, rae.height, rae.duration_ms, rae.is_favorite, rae.thumb_hash, rae.checksum, rae.owner_id, rae.live_photo_video_id, 0 AS orientation, rae.stack_id, NULL AS i_cloud_id, NULL AS latitude, NULL AS longitude, NULL AS adjustmentTime, rae.is_edited, 0 AS playback_style, rae.uploaded_at FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandeduserIds) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT NULL AS remote_id, lae.id AS local_id, lae.name, lae.type, lae.created_at AS created_at, lae.updated_at, lae.width, lae.height, lae.duration_ms, lae.is_favorite, NULL AS thumb_hash, lae.checksum, NULL AS owner_id, NULL AS live_photo_video_id, lae.orientation, NULL AS stack_id, lae.i_cloud_id, lae.latitude, lae.longitude, lae.adjustment_time, 0 AS is_edited, lae.playback_style, NULL AS uploaded_at FROM local_asset_entity AS lae WHERE NOT EXISTS (SELECT 1 FROM remote_asset_entity AS rae WHERE rae.checksum = lae.checksum AND rae.owner_id IN ($expandeduserIds)) AND EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 0) AND NOT EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 2) ORDER BY created_at DESC ${generatedlimit.sql}', - variables: [ - for (var $ in userIds) i0.Variable($), - ...generatedlimit.introducedVariables, - ], - readsFrom: { - remoteAssetEntity, - localAssetEntity, - stackEntity, - localAlbumAssetEntity, - localAlbumEntity, - ...generatedlimit.watchedTables, - }, - ).map( - (i0.QueryRow row) => MergedAssetResult( - remoteId: row.readNullable('remote_id'), - localId: row.readNullable('local_id'), - name: row.read('name'), - type: i4.$RemoteAssetEntityTable.$convertertype.fromSql( - row.read('type'), - ), - createdAt: row.read('created_at'), - updatedAt: row.read('updated_at'), - width: row.readNullable('width'), - height: row.readNullable('height'), - durationMs: row.readNullable('duration_ms'), - isFavorite: row.read('is_favorite'), - thumbHash: row.readNullable('thumb_hash'), - checksum: row.readNullable('checksum'), - ownerId: row.readNullable('owner_id'), - livePhotoVideoId: row.readNullable('live_photo_video_id'), - orientation: row.read('orientation'), - stackId: row.readNullable('stack_id'), - iCloudId: row.readNullable('i_cloud_id'), - latitude: row.readNullable('latitude'), - longitude: row.readNullable('longitude'), - adjustmentTime: row.readNullable('adjustmentTime'), - isEdited: row.read('is_edited'), - playbackStyle: row.read('playback_style'), - uploadedAt: row.readNullable('uploaded_at'), - ), - ); - } - - i0.Selectable mergedBucket({ - required int groupBy, - required List userIds, - }) { - var $arrayStartIndex = 2; - final expandeduserIds = $expandVar($arrayStartIndex, userIds.length); - $arrayStartIndex += userIds.length; - return customSelect( - 'SELECT COUNT(*) AS asset_count, bucket_date FROM (SELECT CASE WHEN ?1 = 0 THEN COALESCE(STRFTIME(\'%Y-%m-%d\', rae.local_date_time), STRFTIME(\'%Y-%m-%d\', rae.created_at, \'localtime\')) WHEN ?1 = 1 THEN COALESCE(STRFTIME(\'%Y-%m\', rae.local_date_time), STRFTIME(\'%Y-%m\', rae.created_at, \'localtime\')) END AS bucket_date FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandeduserIds) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT CASE WHEN ?1 = 0 THEN STRFTIME(\'%Y-%m-%d\', lae.created_at, \'localtime\') WHEN ?1 = 1 THEN STRFTIME(\'%Y-%m\', lae.created_at, \'localtime\') END AS bucket_date FROM local_asset_entity AS lae WHERE NOT EXISTS (SELECT 1 FROM remote_asset_entity AS rae WHERE rae.checksum = lae.checksum AND rae.owner_id IN ($expandeduserIds)) AND EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 0) AND NOT EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 2)) GROUP BY bucket_date ORDER BY bucket_date DESC', - variables: [ - i0.Variable(groupBy), - for (var $ in userIds) i0.Variable($), - ], - readsFrom: { - remoteAssetEntity, - stackEntity, - localAssetEntity, - localAlbumAssetEntity, - localAlbumEntity, - }, - ).map( - (i0.QueryRow row) => MergedBucketResult( - assetCount: row.read('asset_count'), - bucketDate: row.read('bucket_date'), - ), - ); - } - - i4.$RemoteAssetEntityTable get remoteAssetEntity => i1.ReadDatabaseContainer( - attachedDatabase, - ).resultSet('remote_asset_entity'); - i5.$StackEntityTable get stackEntity => i1.ReadDatabaseContainer( - attachedDatabase, - ).resultSet('stack_entity'); - i3.$LocalAssetEntityTable get localAssetEntity => i1.ReadDatabaseContainer( - attachedDatabase, - ).resultSet('local_asset_entity'); - i6.$LocalAlbumAssetEntityTable get localAlbumAssetEntity => - i1.ReadDatabaseContainer( - attachedDatabase, - ).resultSet('local_album_asset_entity'); - i7.$LocalAlbumEntityTable get localAlbumEntity => i1.ReadDatabaseContainer( - attachedDatabase, - ).resultSet('local_album_entity'); -} - -class MergedAssetResult { - final String? remoteId; - final String? localId; - final String name; - final i2.AssetType type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationMs; - final bool isFavorite; - final String? thumbHash; - final String? checksum; - final String? ownerId; - final String? livePhotoVideoId; - final int orientation; - final String? stackId; - final String? iCloudId; - final double? latitude; - final double? longitude; - final DateTime? adjustmentTime; - final bool isEdited; - final int playbackStyle; - final DateTime? uploadedAt; - MergedAssetResult({ - this.remoteId, - this.localId, - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.isFavorite, - this.thumbHash, - this.checksum, - this.ownerId, - this.livePhotoVideoId, - required this.orientation, - this.stackId, - this.iCloudId, - this.latitude, - this.longitude, - this.adjustmentTime, - required this.isEdited, - required this.playbackStyle, - this.uploadedAt, - }); -} - -typedef MergedAsset$limit = i0.Limit Function(i3.$LocalAssetEntityTable lae); - -class MergedBucketResult { - final int assetCount; - final String bucketDate; - MergedBucketResult({required this.assetCount, required this.bucketDate}); -} diff --git a/mobile/lib/infrastructure/entities/partner.entity.drift.dart b/mobile/lib/infrastructure/entities/partner.entity.drift.dart deleted file mode 100644 index ef1735cb97..0000000000 --- a/mobile/lib/infrastructure/entities/partner.entity.drift.dart +++ /dev/null @@ -1,707 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/partner.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/partner.entity.dart' - as i2; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i4; -import 'package:drift/internal/modular.dart' as i5; - -typedef $$PartnerEntityTableCreateCompanionBuilder = - i1.PartnerEntityCompanion Function({ - required String sharedById, - required String sharedWithId, - i0.Value inTimeline, - }); -typedef $$PartnerEntityTableUpdateCompanionBuilder = - i1.PartnerEntityCompanion Function({ - i0.Value sharedById, - i0.Value sharedWithId, - i0.Value inTimeline, - }); - -final class $$PartnerEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$PartnerEntityTable, - i1.PartnerEntityData - > { - $$PartnerEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i4.$UserEntityTable _sharedByIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('partner_entity__shared_by_id__user_entity__id'); - - i4.$$UserEntityTableProcessedTableManager get sharedById { - final $_column = $_itemColumn('shared_by_id')!; - - final manager = i4 - .$$UserEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_sharedByIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static i4.$UserEntityTable _sharedWithIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('partner_entity__shared_with_id__user_entity__id'); - - i4.$$UserEntityTableProcessedTableManager get sharedWithId { - final $_column = $_itemColumn('shared_with_id')!; - - final manager = i4 - .$$UserEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_sharedWithIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$PartnerEntityTableFilterComposer - extends i0.Composer { - $$PartnerEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get inTimeline => $composableBuilder( - column: $table.inTimeline, - builder: (column) => i0.ColumnFilters(column), - ); - - i4.$$UserEntityTableFilterComposer get sharedById { - final i4.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sharedById, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i4.$$UserEntityTableFilterComposer get sharedWithId { - final i4.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sharedWithId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$PartnerEntityTableOrderingComposer - extends i0.Composer { - $$PartnerEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get inTimeline => $composableBuilder( - column: $table.inTimeline, - builder: (column) => i0.ColumnOrderings(column), - ); - - i4.$$UserEntityTableOrderingComposer get sharedById { - final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sharedById, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i4.$$UserEntityTableOrderingComposer get sharedWithId { - final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sharedWithId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$PartnerEntityTableAnnotationComposer - extends i0.Composer { - $$PartnerEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get inTimeline => $composableBuilder( - column: $table.inTimeline, - builder: (column) => column, - ); - - i4.$$UserEntityTableAnnotationComposer get sharedById { - final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sharedById, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i4.$$UserEntityTableAnnotationComposer get sharedWithId { - final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sharedWithId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$PartnerEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$PartnerEntityTable, - i1.PartnerEntityData, - i1.$$PartnerEntityTableFilterComposer, - i1.$$PartnerEntityTableOrderingComposer, - i1.$$PartnerEntityTableAnnotationComposer, - $$PartnerEntityTableCreateCompanionBuilder, - $$PartnerEntityTableUpdateCompanionBuilder, - (i1.PartnerEntityData, i1.$$PartnerEntityTableReferences), - i1.PartnerEntityData, - i0.PrefetchHooks Function({bool sharedById, bool sharedWithId}) - > { - $$PartnerEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$PartnerEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$PartnerEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$PartnerEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$PartnerEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value sharedById = const i0.Value.absent(), - i0.Value sharedWithId = const i0.Value.absent(), - i0.Value inTimeline = const i0.Value.absent(), - }) => i1.PartnerEntityCompanion( - sharedById: sharedById, - sharedWithId: sharedWithId, - inTimeline: inTimeline, - ), - createCompanionCallback: - ({ - required String sharedById, - required String sharedWithId, - i0.Value inTimeline = const i0.Value.absent(), - }) => i1.PartnerEntityCompanion.insert( - sharedById: sharedById, - sharedWithId: sharedWithId, - inTimeline: inTimeline, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$PartnerEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({sharedById = false, sharedWithId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (sharedById) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.sharedById, - referencedTable: i1 - .$$PartnerEntityTableReferences - ._sharedByIdTable(db), - referencedColumn: i1 - .$$PartnerEntityTableReferences - ._sharedByIdTable(db) - .id, - ) - as T; - } - if (sharedWithId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.sharedWithId, - referencedTable: i1 - .$$PartnerEntityTableReferences - ._sharedWithIdTable(db), - referencedColumn: i1 - .$$PartnerEntityTableReferences - ._sharedWithIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$PartnerEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$PartnerEntityTable, - i1.PartnerEntityData, - i1.$$PartnerEntityTableFilterComposer, - i1.$$PartnerEntityTableOrderingComposer, - i1.$$PartnerEntityTableAnnotationComposer, - $$PartnerEntityTableCreateCompanionBuilder, - $$PartnerEntityTableUpdateCompanionBuilder, - (i1.PartnerEntityData, i1.$$PartnerEntityTableReferences), - i1.PartnerEntityData, - i0.PrefetchHooks Function({bool sharedById, bool sharedWithId}) - >; -i0.Index get idxPartnerSharedWithId => i0.Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', -); - -class $PartnerEntityTable extends i2.PartnerEntity - with i0.TableInfo<$PartnerEntityTable, i1.PartnerEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $PartnerEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _sharedByIdMeta = const i0.VerificationMeta( - 'sharedById', - ); - @override - late final i0.GeneratedColumn sharedById = i0.GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _sharedWithIdMeta = - const i0.VerificationMeta('sharedWithId'); - @override - late final i0.GeneratedColumn sharedWithId = - i0.GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _inTimelineMeta = const i0.VerificationMeta( - 'inTimeline', - ); - @override - late final i0.GeneratedColumn inTimeline = i0.GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const i3.Constant(false), - ); - @override - List get $columns => [ - sharedById, - sharedWithId, - inTimeline, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('shared_by_id')) { - context.handle( - _sharedByIdMeta, - sharedById.isAcceptableOrUnknown( - data['shared_by_id']!, - _sharedByIdMeta, - ), - ); - } else if (isInserting) { - context.missing(_sharedByIdMeta); - } - if (data.containsKey('shared_with_id')) { - context.handle( - _sharedWithIdMeta, - sharedWithId.isAcceptableOrUnknown( - data['shared_with_id']!, - _sharedWithIdMeta, - ), - ); - } else if (isInserting) { - context.missing(_sharedWithIdMeta); - } - if (data.containsKey('in_timeline')) { - context.handle( - _inTimelineMeta, - inTimeline.isAcceptableOrUnknown(data['in_timeline']!, _inTimelineMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - i1.PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - $PartnerEntityTable createAlias(String alias) { - return $PartnerEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends i0.DataClass - implements i0.Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = i0.Variable(sharedById); - map['shared_with_id'] = i0.Variable(sharedWithId); - map['in_timeline'] = i0.Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - i1.PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => i1.PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(i1.PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends i0.UpdateCompanion { - final i0.Value sharedById; - final i0.Value sharedWithId; - final i0.Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const i0.Value.absent(), - this.sharedWithId = const i0.Value.absent(), - this.inTimeline = const i0.Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const i0.Value.absent(), - }) : sharedById = i0.Value(sharedById), - sharedWithId = i0.Value(sharedWithId); - static i0.Insertable custom({ - i0.Expression? sharedById, - i0.Expression? sharedWithId, - i0.Expression? inTimeline, - }) { - return i0.RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - i1.PartnerEntityCompanion copyWith({ - i0.Value? sharedById, - i0.Value? sharedWithId, - i0.Value? inTimeline, - }) { - return i1.PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = i0.Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = i0.Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = i0.Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/person.entity.drift.dart b/mobile/lib/infrastructure/entities/person.entity.drift.dart deleted file mode 100644 index f042c4d322..0000000000 --- a/mobile/lib/infrastructure/entities/person.entity.drift.dart +++ /dev/null @@ -1,1053 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/person.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/person.entity.dart' as i2; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i4; -import 'package:drift/internal/modular.dart' as i5; - -typedef $$PersonEntityTableCreateCompanionBuilder = - i1.PersonEntityCompanion Function({ - required String id, - i0.Value createdAt, - i0.Value updatedAt, - required String ownerId, - required String name, - i0.Value faceAssetId, - required bool isFavorite, - required bool isHidden, - i0.Value color, - i0.Value birthDate, - }); -typedef $$PersonEntityTableUpdateCompanionBuilder = - i1.PersonEntityCompanion Function({ - i0.Value id, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value ownerId, - i0.Value name, - i0.Value faceAssetId, - i0.Value isFavorite, - i0.Value isHidden, - i0.Value color, - i0.Value birthDate, - }); - -final class $$PersonEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$PersonEntityTable, - i1.PersonEntityData - > { - $$PersonEntityTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static i4.$UserEntityTable _ownerIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('person_entity__owner_id__user_entity__id'); - - i4.$$UserEntityTableProcessedTableManager get ownerId { - final $_column = $_itemColumn('owner_id')!; - - final manager = i4 - .$$UserEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_ownerIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$PersonEntityTableFilterComposer - extends i0.Composer { - $$PersonEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get faceAssetId => $composableBuilder( - column: $table.faceAssetId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isHidden => $composableBuilder( - column: $table.isHidden, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get color => $composableBuilder( - column: $table.color, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get birthDate => $composableBuilder( - column: $table.birthDate, - builder: (column) => i0.ColumnFilters(column), - ); - - i4.$$UserEntityTableFilterComposer get ownerId { - final i4.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$PersonEntityTableOrderingComposer - extends i0.Composer { - $$PersonEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get faceAssetId => $composableBuilder( - column: $table.faceAssetId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isHidden => $composableBuilder( - column: $table.isHidden, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get color => $composableBuilder( - column: $table.color, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get birthDate => $composableBuilder( - column: $table.birthDate, - builder: (column) => i0.ColumnOrderings(column), - ); - - i4.$$UserEntityTableOrderingComposer get ownerId { - final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$PersonEntityTableAnnotationComposer - extends i0.Composer { - $$PersonEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumn get faceAssetId => $composableBuilder( - column: $table.faceAssetId, - builder: (column) => column, - ); - - i0.GeneratedColumn get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => column, - ); - - i0.GeneratedColumn get isHidden => - $composableBuilder(column: $table.isHidden, builder: (column) => column); - - i0.GeneratedColumn get color => - $composableBuilder(column: $table.color, builder: (column) => column); - - i0.GeneratedColumn get birthDate => - $composableBuilder(column: $table.birthDate, builder: (column) => column); - - i4.$$UserEntityTableAnnotationComposer get ownerId { - final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$PersonEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$PersonEntityTable, - i1.PersonEntityData, - i1.$$PersonEntityTableFilterComposer, - i1.$$PersonEntityTableOrderingComposer, - i1.$$PersonEntityTableAnnotationComposer, - $$PersonEntityTableCreateCompanionBuilder, - $$PersonEntityTableUpdateCompanionBuilder, - (i1.PersonEntityData, i1.$$PersonEntityTableReferences), - i1.PersonEntityData, - i0.PrefetchHooks Function({bool ownerId}) - > { - $$PersonEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$PersonEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$PersonEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$PersonEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$PersonEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value ownerId = const i0.Value.absent(), - i0.Value name = const i0.Value.absent(), - i0.Value faceAssetId = const i0.Value.absent(), - i0.Value isFavorite = const i0.Value.absent(), - i0.Value isHidden = const i0.Value.absent(), - i0.Value color = const i0.Value.absent(), - i0.Value birthDate = const i0.Value.absent(), - }) => i1.PersonEntityCompanion( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - ownerId: ownerId, - name: name, - faceAssetId: faceAssetId, - isFavorite: isFavorite, - isHidden: isHidden, - color: color, - birthDate: birthDate, - ), - createCompanionCallback: - ({ - required String id, - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - required String ownerId, - required String name, - i0.Value faceAssetId = const i0.Value.absent(), - required bool isFavorite, - required bool isHidden, - i0.Value color = const i0.Value.absent(), - i0.Value birthDate = const i0.Value.absent(), - }) => i1.PersonEntityCompanion.insert( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - ownerId: ownerId, - name: name, - faceAssetId: faceAssetId, - isFavorite: isFavorite, - isHidden: isHidden, - color: color, - birthDate: birthDate, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$PersonEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({ownerId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (ownerId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.ownerId, - referencedTable: i1 - .$$PersonEntityTableReferences - ._ownerIdTable(db), - referencedColumn: i1 - .$$PersonEntityTableReferences - ._ownerIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$PersonEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$PersonEntityTable, - i1.PersonEntityData, - i1.$$PersonEntityTableFilterComposer, - i1.$$PersonEntityTableOrderingComposer, - i1.$$PersonEntityTableAnnotationComposer, - $$PersonEntityTableCreateCompanionBuilder, - $$PersonEntityTableUpdateCompanionBuilder, - (i1.PersonEntityData, i1.$$PersonEntityTableReferences), - i1.PersonEntityData, - i0.PrefetchHooks Function({bool ownerId}) - >; -i0.Index get idxPersonOwnerId => i0.Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', -); - -class $PersonEntityTable extends i2.PersonEntity - with i0.TableInfo<$PersonEntityTable, i1.PersonEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $PersonEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i3.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i3.currentDateAndTime, - ); - static const i0.VerificationMeta _ownerIdMeta = const i0.VerificationMeta( - 'ownerId', - ); - @override - late final i0.GeneratedColumn ownerId = i0.GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _faceAssetIdMeta = const i0.VerificationMeta( - 'faceAssetId', - ); - @override - late final i0.GeneratedColumn faceAssetId = - i0.GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _isFavoriteMeta = const i0.VerificationMeta( - 'isFavorite', - ); - @override - late final i0.GeneratedColumn isFavorite = i0.GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - static const i0.VerificationMeta _isHiddenMeta = const i0.VerificationMeta( - 'isHidden', - ); - @override - late final i0.GeneratedColumn isHidden = i0.GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - static const i0.VerificationMeta _colorMeta = const i0.VerificationMeta( - 'color', - ); - @override - late final i0.GeneratedColumn color = i0.GeneratedColumn( - 'color', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _birthDateMeta = const i0.VerificationMeta( - 'birthDate', - ); - @override - late final i0.GeneratedColumn birthDate = - i0.GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('owner_id')) { - context.handle( - _ownerIdMeta, - ownerId.isAcceptableOrUnknown(data['owner_id']!, _ownerIdMeta), - ); - } else if (isInserting) { - context.missing(_ownerIdMeta); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('face_asset_id')) { - context.handle( - _faceAssetIdMeta, - faceAssetId.isAcceptableOrUnknown( - data['face_asset_id']!, - _faceAssetIdMeta, - ), - ); - } - if (data.containsKey('is_favorite')) { - context.handle( - _isFavoriteMeta, - isFavorite.isAcceptableOrUnknown(data['is_favorite']!, _isFavoriteMeta), - ); - } else if (isInserting) { - context.missing(_isFavoriteMeta); - } - if (data.containsKey('is_hidden')) { - context.handle( - _isHiddenMeta, - isHidden.isAcceptableOrUnknown(data['is_hidden']!, _isHiddenMeta), - ); - } else if (isInserting) { - context.missing(_isHiddenMeta); - } - if (data.containsKey('color')) { - context.handle( - _colorMeta, - color.isAcceptableOrUnknown(data['color']!, _colorMeta), - ); - } - if (data.containsKey('birth_date')) { - context.handle( - _birthDateMeta, - birthDate.isAcceptableOrUnknown(data['birth_date']!, _birthDateMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.PersonEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - $PersonEntityTable createAlias(String alias) { - return $PersonEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - map['owner_id'] = i0.Variable(ownerId); - map['name'] = i0.Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = i0.Variable(faceAssetId); - } - map['is_favorite'] = i0.Variable(isFavorite); - map['is_hidden'] = i0.Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = i0.Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = i0.Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - i1.PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - i0.Value faceAssetId = const i0.Value.absent(), - bool? isFavorite, - bool? isHidden, - i0.Value color = const i0.Value.absent(), - i0.Value birthDate = const i0.Value.absent(), - }) => i1.PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(i1.PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value ownerId; - final i0.Value name; - final i0.Value faceAssetId; - final i0.Value isFavorite; - final i0.Value isHidden; - final i0.Value color; - final i0.Value birthDate; - const PersonEntityCompanion({ - this.id = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.ownerId = const i0.Value.absent(), - this.name = const i0.Value.absent(), - this.faceAssetId = const i0.Value.absent(), - this.isFavorite = const i0.Value.absent(), - this.isHidden = const i0.Value.absent(), - this.color = const i0.Value.absent(), - this.birthDate = const i0.Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const i0.Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const i0.Value.absent(), - this.birthDate = const i0.Value.absent(), - }) : id = i0.Value(id), - ownerId = i0.Value(ownerId), - name = i0.Value(name), - isFavorite = i0.Value(isFavorite), - isHidden = i0.Value(isHidden); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? ownerId, - i0.Expression? name, - i0.Expression? faceAssetId, - i0.Expression? isFavorite, - i0.Expression? isHidden, - i0.Expression? color, - i0.Expression? birthDate, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - i1.PersonEntityCompanion copyWith({ - i0.Value? id, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? ownerId, - i0.Value? name, - i0.Value? faceAssetId, - i0.Value? isFavorite, - i0.Value? isHidden, - i0.Value? color, - i0.Value? birthDate, - }) { - return i1.PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = i0.Variable(ownerId.value); - } - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = i0.Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = i0.Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = i0.Variable(isHidden.value); - } - if (color.present) { - map['color'] = i0.Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = i0.Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/remote_album.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_album.entity.drift.dart deleted file mode 100644 index c0fb442d15..0000000000 --- a/mobile/lib/infrastructure/entities/remote_album.entity.drift.dart +++ /dev/null @@ -1,949 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/album/album.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/remote_album.entity.dart' - as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i5; -import 'package:drift/internal/modular.dart' as i6; - -typedef $$RemoteAlbumEntityTableCreateCompanionBuilder = - i1.RemoteAlbumEntityCompanion Function({ - required String id, - required String name, - i0.Value description, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value thumbnailAssetId, - i0.Value isActivityEnabled, - required i2.AlbumAssetOrder order, - }); -typedef $$RemoteAlbumEntityTableUpdateCompanionBuilder = - i1.RemoteAlbumEntityCompanion Function({ - i0.Value id, - i0.Value name, - i0.Value description, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value thumbnailAssetId, - i0.Value isActivityEnabled, - i0.Value order, - }); - -final class $$RemoteAlbumEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$RemoteAlbumEntityTable, - i1.RemoteAlbumEntityData - > { - $$RemoteAlbumEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i5.$RemoteAssetEntityTable _thumbnailAssetIdTable( - i0.GeneratedDatabase db, - ) => i6.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias( - 'remote_album_entity__thumbnail_asset_id__remote_asset_entity__id', - ); - - i5.$$RemoteAssetEntityTableProcessedTableManager? get thumbnailAssetId { - final $_column = $_itemColumn('thumbnail_asset_id'); - if ($_column == null) return null; - final manager = i5 - .$$RemoteAssetEntityTableTableManager( - $_db, - i6.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_thumbnailAssetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$RemoteAlbumEntityTableFilterComposer - extends i0.Composer { - $$RemoteAlbumEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get description => $composableBuilder( - column: $table.description, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isActivityEnabled => $composableBuilder( - column: $table.isActivityEnabled, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get order => $composableBuilder( - column: $table.order, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i5.$$RemoteAssetEntityTableFilterComposer get thumbnailAssetId { - final i5.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.thumbnailAssetId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumEntityTableOrderingComposer - extends i0.Composer { - $$RemoteAlbumEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get description => $composableBuilder( - column: $table.description, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isActivityEnabled => $composableBuilder( - column: $table.isActivityEnabled, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get order => $composableBuilder( - column: $table.order, - builder: (column) => i0.ColumnOrderings(column), - ); - - i5.$$RemoteAssetEntityTableOrderingComposer get thumbnailAssetId { - final i5.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.thumbnailAssetId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumEntityTableAnnotationComposer - extends i0.Composer { - $$RemoteAlbumEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumn get description => $composableBuilder( - column: $table.description, - builder: (column) => column, - ); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get isActivityEnabled => $composableBuilder( - column: $table.isActivityEnabled, - builder: (column) => column, - ); - - i0.GeneratedColumnWithTypeConverter get order => - $composableBuilder(column: $table.order, builder: (column) => column); - - i5.$$RemoteAssetEntityTableAnnotationComposer get thumbnailAssetId { - final i5.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.thumbnailAssetId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$RemoteAlbumEntityTable, - i1.RemoteAlbumEntityData, - i1.$$RemoteAlbumEntityTableFilterComposer, - i1.$$RemoteAlbumEntityTableOrderingComposer, - i1.$$RemoteAlbumEntityTableAnnotationComposer, - $$RemoteAlbumEntityTableCreateCompanionBuilder, - $$RemoteAlbumEntityTableUpdateCompanionBuilder, - (i1.RemoteAlbumEntityData, i1.$$RemoteAlbumEntityTableReferences), - i1.RemoteAlbumEntityData, - i0.PrefetchHooks Function({bool thumbnailAssetId}) - > { - $$RemoteAlbumEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$RemoteAlbumEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$RemoteAlbumEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$RemoteAlbumEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$RemoteAlbumEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value name = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value thumbnailAssetId = const i0.Value.absent(), - i0.Value isActivityEnabled = const i0.Value.absent(), - i0.Value order = const i0.Value.absent(), - }) => i1.RemoteAlbumEntityCompanion( - id: id, - name: name, - description: description, - createdAt: createdAt, - updatedAt: updatedAt, - thumbnailAssetId: thumbnailAssetId, - isActivityEnabled: isActivityEnabled, - order: order, - ), - createCompanionCallback: - ({ - required String id, - required String name, - i0.Value description = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value thumbnailAssetId = const i0.Value.absent(), - i0.Value isActivityEnabled = const i0.Value.absent(), - required i2.AlbumAssetOrder order, - }) => i1.RemoteAlbumEntityCompanion.insert( - id: id, - name: name, - description: description, - createdAt: createdAt, - updatedAt: updatedAt, - thumbnailAssetId: thumbnailAssetId, - isActivityEnabled: isActivityEnabled, - order: order, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$RemoteAlbumEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({thumbnailAssetId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (thumbnailAssetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.thumbnailAssetId, - referencedTable: i1 - .$$RemoteAlbumEntityTableReferences - ._thumbnailAssetIdTable(db), - referencedColumn: i1 - .$$RemoteAlbumEntityTableReferences - ._thumbnailAssetIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$RemoteAlbumEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$RemoteAlbumEntityTable, - i1.RemoteAlbumEntityData, - i1.$$RemoteAlbumEntityTableFilterComposer, - i1.$$RemoteAlbumEntityTableOrderingComposer, - i1.$$RemoteAlbumEntityTableAnnotationComposer, - $$RemoteAlbumEntityTableCreateCompanionBuilder, - $$RemoteAlbumEntityTableUpdateCompanionBuilder, - (i1.RemoteAlbumEntityData, i1.$$RemoteAlbumEntityTableReferences), - i1.RemoteAlbumEntityData, - i0.PrefetchHooks Function({bool thumbnailAssetId}) - >; - -class $RemoteAlbumEntityTable extends i3.RemoteAlbumEntity - with i0.TableInfo<$RemoteAlbumEntityTable, i1.RemoteAlbumEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $RemoteAlbumEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _descriptionMeta = const i0.VerificationMeta( - 'description', - ); - @override - late final i0.GeneratedColumn description = - i0.GeneratedColumn( - 'description', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const i4.Constant(''), - ); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _thumbnailAssetIdMeta = - const i0.VerificationMeta('thumbnailAssetId'); - @override - late final i0.GeneratedColumn thumbnailAssetId = - i0.GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - static const i0.VerificationMeta _isActivityEnabledMeta = - const i0.VerificationMeta('isActivityEnabled'); - @override - late final i0.GeneratedColumn isActivityEnabled = - i0.GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const i4.Constant(true), - ); - @override - late final i0.GeneratedColumnWithTypeConverter - order = - i0.GeneratedColumn( - 'order', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$RemoteAlbumEntityTable.$converterorder, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('description')) { - context.handle( - _descriptionMeta, - description.isAcceptableOrUnknown( - data['description']!, - _descriptionMeta, - ), - ); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('thumbnail_asset_id')) { - context.handle( - _thumbnailAssetIdMeta, - thumbnailAssetId.isAcceptableOrUnknown( - data['thumbnail_asset_id']!, - _thumbnailAssetIdMeta, - ), - ); - } - if (data.containsKey('is_activity_enabled')) { - context.handle( - _isActivityEnabledMeta, - isActivityEnabled.isAcceptableOrUnknown( - data['is_activity_enabled']!, - _isActivityEnabledMeta, - ), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.RemoteAlbumEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: i1.$RemoteAlbumEntityTable.$converterorder.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ), - ); - } - - @override - $RemoteAlbumEntityTable createAlias(String alias) { - return $RemoteAlbumEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converterorder = - const i0.EnumIndexConverter( - i2.AlbumAssetOrder.values, - ); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final i2.AlbumAssetOrder order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['name'] = i0.Variable(name); - map['description'] = i0.Variable(description); - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = i0.Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = i0.Variable(isActivityEnabled); - { - map['order'] = i0.Variable( - i1.$RemoteAlbumEntityTable.$converterorder.toSql(order), - ); - } - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: i1.$RemoteAlbumEntityTable.$converterorder.fromJson( - serializer.fromJson(json['order']), - ), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson( - i1.$RemoteAlbumEntityTable.$converterorder.toJson(order), - ), - }; - } - - i1.RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - i0.Value thumbnailAssetId = const i0.Value.absent(), - bool? isActivityEnabled, - i2.AlbumAssetOrder? order, - }) => i1.RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(i1.RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value name; - final i0.Value description; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value thumbnailAssetId; - final i0.Value isActivityEnabled; - final i0.Value order; - const RemoteAlbumEntityCompanion({ - this.id = const i0.Value.absent(), - this.name = const i0.Value.absent(), - this.description = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.thumbnailAssetId = const i0.Value.absent(), - this.isActivityEnabled = const i0.Value.absent(), - this.order = const i0.Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.thumbnailAssetId = const i0.Value.absent(), - this.isActivityEnabled = const i0.Value.absent(), - required i2.AlbumAssetOrder order, - }) : id = i0.Value(id), - name = i0.Value(name), - order = i0.Value(order); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? name, - i0.Expression? description, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? thumbnailAssetId, - i0.Expression? isActivityEnabled, - i0.Expression? order, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - i1.RemoteAlbumEntityCompanion copyWith({ - i0.Value? id, - i0.Value? name, - i0.Value? description, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? thumbnailAssetId, - i0.Value? isActivityEnabled, - i0.Value? order, - }) { - return i1.RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (description.present) { - map['description'] = i0.Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = i0.Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = i0.Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = i0.Variable( - i1.$RemoteAlbumEntityTable.$converterorder.toSql(order.value), - ); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/remote_album_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_album_asset.entity.drift.dart deleted file mode 100644 index 4ce7195717..0000000000 --- a/mobile/lib/infrastructure/entities/remote_album_asset.entity.drift.dart +++ /dev/null @@ -1,654 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.dart' - as i2; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i3; -import 'package:drift/internal/modular.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart' - as i5; - -typedef $$RemoteAlbumAssetEntityTableCreateCompanionBuilder = - i1.RemoteAlbumAssetEntityCompanion Function({ - required String assetId, - required String albumId, - }); -typedef $$RemoteAlbumAssetEntityTableUpdateCompanionBuilder = - i1.RemoteAlbumAssetEntityCompanion Function({ - i0.Value assetId, - i0.Value albumId, - }); - -final class $$RemoteAlbumAssetEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$RemoteAlbumAssetEntityTable, - i1.RemoteAlbumAssetEntityData - > { - $$RemoteAlbumAssetEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias( - 'remote_album_asset_entity__asset_id__remote_asset_entity__id', - ); - - i3.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i3 - .$$RemoteAssetEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static i5.$RemoteAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('remote_album_entity') - .createAlias( - 'remote_album_asset_entity__album_id__remote_album_entity__id', - ); - - i5.$$RemoteAlbumEntityTableProcessedTableManager get albumId { - final $_column = $_itemColumn('album_id')!; - - final manager = i5 - .$$RemoteAlbumEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('remote_album_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_albumIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$RemoteAlbumAssetEntityTableFilterComposer - extends i0.Composer { - $$RemoteAlbumAssetEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i3.$$RemoteAssetEntityTableFilterComposer get assetId { - final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$RemoteAlbumEntityTableFilterComposer get albumId { - final i5.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAlbumEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumAssetEntityTableOrderingComposer - extends i0.Composer { - $$RemoteAlbumAssetEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i3.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i3.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$RemoteAlbumEntityTableOrderingComposer get albumId { - final i5.$$RemoteAlbumEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAlbumEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumAssetEntityTableAnnotationComposer - extends i0.Composer { - $$RemoteAlbumAssetEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i3.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i3.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i5.$$RemoteAlbumEntityTableAnnotationComposer get albumId { - final i5.$$RemoteAlbumEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$RemoteAlbumEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumAssetEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$RemoteAlbumAssetEntityTable, - i1.RemoteAlbumAssetEntityData, - i1.$$RemoteAlbumAssetEntityTableFilterComposer, - i1.$$RemoteAlbumAssetEntityTableOrderingComposer, - i1.$$RemoteAlbumAssetEntityTableAnnotationComposer, - $$RemoteAlbumAssetEntityTableCreateCompanionBuilder, - $$RemoteAlbumAssetEntityTableUpdateCompanionBuilder, - ( - i1.RemoteAlbumAssetEntityData, - i1.$$RemoteAlbumAssetEntityTableReferences, - ), - i1.RemoteAlbumAssetEntityData, - i0.PrefetchHooks Function({bool assetId, bool albumId}) - > { - $$RemoteAlbumAssetEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$RemoteAlbumAssetEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$RemoteAlbumAssetEntityTableFilterComposer( - $db: db, - $table: table, - ), - createOrderingComposer: () => - i1.$$RemoteAlbumAssetEntityTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - i1.$$RemoteAlbumAssetEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value assetId = const i0.Value.absent(), - i0.Value albumId = const i0.Value.absent(), - }) => i1.RemoteAlbumAssetEntityCompanion( - assetId: assetId, - albumId: albumId, - ), - createCompanionCallback: - ({required String assetId, required String albumId}) => - i1.RemoteAlbumAssetEntityCompanion.insert( - assetId: assetId, - albumId: albumId, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$RemoteAlbumAssetEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false, albumId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$RemoteAlbumAssetEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$RemoteAlbumAssetEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - if (albumId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.albumId, - referencedTable: i1 - .$$RemoteAlbumAssetEntityTableReferences - ._albumIdTable(db), - referencedColumn: i1 - .$$RemoteAlbumAssetEntityTableReferences - ._albumIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$RemoteAlbumAssetEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$RemoteAlbumAssetEntityTable, - i1.RemoteAlbumAssetEntityData, - i1.$$RemoteAlbumAssetEntityTableFilterComposer, - i1.$$RemoteAlbumAssetEntityTableOrderingComposer, - i1.$$RemoteAlbumAssetEntityTableAnnotationComposer, - $$RemoteAlbumAssetEntityTableCreateCompanionBuilder, - $$RemoteAlbumAssetEntityTableUpdateCompanionBuilder, - ( - i1.RemoteAlbumAssetEntityData, - i1.$$RemoteAlbumAssetEntityTableReferences, - ), - i1.RemoteAlbumAssetEntityData, - i0.PrefetchHooks Function({bool assetId, bool albumId}) - >; -i0.Index get idxRemoteAlbumAssetAlbumAsset => i0.Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', -); - -class $RemoteAlbumAssetEntityTable extends i2.RemoteAlbumAssetEntity - with - i0.TableInfo< - $RemoteAlbumAssetEntityTable, - i1.RemoteAlbumAssetEntityData - > { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $RemoteAlbumAssetEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta( - 'albumId', - ); - @override - late final i0.GeneratedColumn albumId = i0.GeneratedColumn( - 'album_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('album_id')) { - context.handle( - _albumIdMeta, - albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta), - ); - } else if (isInserting) { - context.missing(_albumIdMeta); - } - return context; - } - - @override - Set get $primaryKey => {assetId, albumId}; - @override - i1.RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - $RemoteAlbumAssetEntityTable createAlias(String alias) { - return $RemoteAlbumAssetEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends i0.DataClass - implements i0.Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = i0.Variable(assetId); - map['album_id'] = i0.Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - i1.RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - i1.RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - i1.RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends i0.UpdateCompanion { - final i0.Value assetId; - final i0.Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const i0.Value.absent(), - this.albumId = const i0.Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = i0.Value(assetId), - albumId = i0.Value(albumId); - static i0.Insertable custom({ - i0.Expression? assetId, - i0.Expression? albumId, - }) { - return i0.RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - i1.RemoteAlbumAssetEntityCompanion copyWith({ - i0.Value? assetId, - i0.Value? albumId, - }) { - return i1.RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = i0.Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/remote_album_user.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_album_user.entity.drift.dart deleted file mode 100644 index 8c6d24df15..0000000000 --- a/mobile/lib/infrastructure/entities/remote_album_user.entity.drift.dart +++ /dev/null @@ -1,719 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/album/album.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.dart' - as i3; -import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart' - as i4; -import 'package:drift/internal/modular.dart' as i5; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i6; - -typedef $$RemoteAlbumUserEntityTableCreateCompanionBuilder = - i1.RemoteAlbumUserEntityCompanion Function({ - required String albumId, - required String userId, - required i2.AlbumUserRole role, - }); -typedef $$RemoteAlbumUserEntityTableUpdateCompanionBuilder = - i1.RemoteAlbumUserEntityCompanion Function({ - i0.Value albumId, - i0.Value userId, - i0.Value role, - }); - -final class $$RemoteAlbumUserEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$RemoteAlbumUserEntityTable, - i1.RemoteAlbumUserEntityData - > { - $$RemoteAlbumUserEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i4.$RemoteAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('remote_album_entity') - .createAlias( - 'remote_album_user_entity__album_id__remote_album_entity__id', - ); - - i4.$$RemoteAlbumEntityTableProcessedTableManager get albumId { - final $_column = $_itemColumn('album_id')!; - - final manager = i4 - .$$RemoteAlbumEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('remote_album_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_albumIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static i6.$UserEntityTable _userIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('remote_album_user_entity__user_id__user_entity__id'); - - i6.$$UserEntityTableProcessedTableManager get userId { - final $_column = $_itemColumn('user_id')!; - - final manager = i6 - .$$UserEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_userIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$RemoteAlbumUserEntityTableFilterComposer - extends i0.Composer { - $$RemoteAlbumUserEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnWithTypeConverterFilters - get role => $composableBuilder( - column: $table.role, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i4.$$RemoteAlbumEntityTableFilterComposer get albumId { - final i4.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAlbumEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i6.$$UserEntityTableFilterComposer get userId { - final i6.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.userId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i6.$$UserEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumUserEntityTableOrderingComposer - extends i0.Composer { - $$RemoteAlbumUserEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get role => $composableBuilder( - column: $table.role, - builder: (column) => i0.ColumnOrderings(column), - ); - - i4.$$RemoteAlbumEntityTableOrderingComposer get albumId { - final i4.$$RemoteAlbumEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAlbumEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i6.$$UserEntityTableOrderingComposer get userId { - final i6.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.userId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i6.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumUserEntityTableAnnotationComposer - extends i0.Composer { - $$RemoteAlbumUserEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumnWithTypeConverter get role => - $composableBuilder(column: $table.role, builder: (column) => column); - - i4.$$RemoteAlbumEntityTableAnnotationComposer get albumId { - final i4.$$RemoteAlbumEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.albumId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$RemoteAlbumEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('remote_album_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - i6.$$UserEntityTableAnnotationComposer get userId { - final i6.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.userId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i6.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAlbumUserEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$RemoteAlbumUserEntityTable, - i1.RemoteAlbumUserEntityData, - i1.$$RemoteAlbumUserEntityTableFilterComposer, - i1.$$RemoteAlbumUserEntityTableOrderingComposer, - i1.$$RemoteAlbumUserEntityTableAnnotationComposer, - $$RemoteAlbumUserEntityTableCreateCompanionBuilder, - $$RemoteAlbumUserEntityTableUpdateCompanionBuilder, - ( - i1.RemoteAlbumUserEntityData, - i1.$$RemoteAlbumUserEntityTableReferences, - ), - i1.RemoteAlbumUserEntityData, - i0.PrefetchHooks Function({bool albumId, bool userId}) - > { - $$RemoteAlbumUserEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$RemoteAlbumUserEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$RemoteAlbumUserEntityTableFilterComposer( - $db: db, - $table: table, - ), - createOrderingComposer: () => - i1.$$RemoteAlbumUserEntityTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - i1.$$RemoteAlbumUserEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value albumId = const i0.Value.absent(), - i0.Value userId = const i0.Value.absent(), - i0.Value role = const i0.Value.absent(), - }) => i1.RemoteAlbumUserEntityCompanion( - albumId: albumId, - userId: userId, - role: role, - ), - createCompanionCallback: - ({ - required String albumId, - required String userId, - required i2.AlbumUserRole role, - }) => i1.RemoteAlbumUserEntityCompanion.insert( - albumId: albumId, - userId: userId, - role: role, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$RemoteAlbumUserEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({albumId = false, userId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (albumId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.albumId, - referencedTable: i1 - .$$RemoteAlbumUserEntityTableReferences - ._albumIdTable(db), - referencedColumn: i1 - .$$RemoteAlbumUserEntityTableReferences - ._albumIdTable(db) - .id, - ) - as T; - } - if (userId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.userId, - referencedTable: i1 - .$$RemoteAlbumUserEntityTableReferences - ._userIdTable(db), - referencedColumn: i1 - .$$RemoteAlbumUserEntityTableReferences - ._userIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$RemoteAlbumUserEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$RemoteAlbumUserEntityTable, - i1.RemoteAlbumUserEntityData, - i1.$$RemoteAlbumUserEntityTableFilterComposer, - i1.$$RemoteAlbumUserEntityTableOrderingComposer, - i1.$$RemoteAlbumUserEntityTableAnnotationComposer, - $$RemoteAlbumUserEntityTableCreateCompanionBuilder, - $$RemoteAlbumUserEntityTableUpdateCompanionBuilder, - (i1.RemoteAlbumUserEntityData, i1.$$RemoteAlbumUserEntityTableReferences), - i1.RemoteAlbumUserEntityData, - i0.PrefetchHooks Function({bool albumId, bool userId}) - >; - -class $RemoteAlbumUserEntityTable extends i3.RemoteAlbumUserEntity - with - i0.TableInfo< - $RemoteAlbumUserEntityTable, - i1.RemoteAlbumUserEntityData - > { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $RemoteAlbumUserEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta( - 'albumId', - ); - @override - late final i0.GeneratedColumn albumId = i0.GeneratedColumn( - 'album_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _userIdMeta = const i0.VerificationMeta( - 'userId', - ); - @override - late final i0.GeneratedColumn userId = i0.GeneratedColumn( - 'user_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - @override - late final i0.GeneratedColumnWithTypeConverter role = - i0.GeneratedColumn( - 'role', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$RemoteAlbumUserEntityTable.$converterrole, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('album_id')) { - context.handle( - _albumIdMeta, - albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta), - ); - } else if (isInserting) { - context.missing(_albumIdMeta); - } - if (data.containsKey('user_id')) { - context.handle( - _userIdMeta, - userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta), - ); - } else if (isInserting) { - context.missing(_userIdMeta); - } - return context; - } - - @override - Set get $primaryKey => {albumId, userId}; - @override - i1.RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: i1.$RemoteAlbumUserEntityTable.$converterrole.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ), - ); - } - - @override - $RemoteAlbumUserEntityTable createAlias(String alias) { - return $RemoteAlbumUserEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converterrole = - const i0.EnumIndexConverter(i2.AlbumUserRole.values); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends i0.DataClass - implements i0.Insertable { - final String albumId; - final String userId; - final i2.AlbumUserRole role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = i0.Variable(albumId); - map['user_id'] = i0.Variable(userId); - { - map['role'] = i0.Variable( - i1.$RemoteAlbumUserEntityTable.$converterrole.toSql(role), - ); - } - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: i1.$RemoteAlbumUserEntityTable.$converterrole.fromJson( - serializer.fromJson(json['role']), - ), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson( - i1.$RemoteAlbumUserEntityTable.$converterrole.toJson(role), - ), - }; - } - - i1.RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - i2.AlbumUserRole? role, - }) => i1.RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - i1.RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends i0.UpdateCompanion { - final i0.Value albumId; - final i0.Value userId; - final i0.Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const i0.Value.absent(), - this.userId = const i0.Value.absent(), - this.role = const i0.Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required i2.AlbumUserRole role, - }) : albumId = i0.Value(albumId), - userId = i0.Value(userId), - role = i0.Value(role); - static i0.Insertable custom({ - i0.Expression? albumId, - i0.Expression? userId, - i0.Expression? role, - }) { - return i0.RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - i1.RemoteAlbumUserEntityCompanion copyWith({ - i0.Value? albumId, - i0.Value? userId, - i0.Value? role, - }) { - return i1.RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = i0.Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = i0.Variable(userId.value); - } - if (role.present) { - map['role'] = i0.Variable( - i1.$RemoteAlbumUserEntityTable.$converterrole.toSql(role.value), - ); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart deleted file mode 100644 index 314e93a9a0..0000000000 --- a/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart +++ /dev/null @@ -1,1776 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/asset/base_asset.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart' - as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i5; -import 'package:drift/internal/modular.dart' as i6; - -typedef $$RemoteAssetEntityTableCreateCompanionBuilder = - i1.RemoteAssetEntityCompanion Function({ - required String name, - required i2.AssetType type, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value width, - i0.Value height, - i0.Value durationMs, - required String id, - required String checksum, - i0.Value isFavorite, - required String ownerId, - i0.Value localDateTime, - i0.Value thumbHash, - i0.Value deletedAt, - i0.Value uploadedAt, - i0.Value livePhotoVideoId, - required i2.AssetVisibility visibility, - i0.Value stackId, - i0.Value libraryId, - i0.Value isEdited, - }); -typedef $$RemoteAssetEntityTableUpdateCompanionBuilder = - i1.RemoteAssetEntityCompanion Function({ - i0.Value name, - i0.Value type, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value width, - i0.Value height, - i0.Value durationMs, - i0.Value id, - i0.Value checksum, - i0.Value isFavorite, - i0.Value ownerId, - i0.Value localDateTime, - i0.Value thumbHash, - i0.Value deletedAt, - i0.Value uploadedAt, - i0.Value livePhotoVideoId, - i0.Value visibility, - i0.Value stackId, - i0.Value libraryId, - i0.Value isEdited, - }); - -final class $$RemoteAssetEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$RemoteAssetEntityTable, - i1.RemoteAssetEntityData - > { - $$RemoteAssetEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i5.$UserEntityTable _ownerIdTable(i0.GeneratedDatabase db) => - i6.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('remote_asset_entity__owner_id__user_entity__id'); - - i5.$$UserEntityTableProcessedTableManager get ownerId { - final $_column = $_itemColumn('owner_id')!; - - final manager = i5 - .$$UserEntityTableTableManager( - $_db, - i6.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_ownerIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$RemoteAssetEntityTableFilterComposer - extends i0.Composer { - $$RemoteAssetEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters get type => - $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get checksum => $composableBuilder( - column: $table.checksum, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get localDateTime => $composableBuilder( - column: $table.localDateTime, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get thumbHash => $composableBuilder( - column: $table.thumbHash, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get deletedAt => $composableBuilder( - column: $table.deletedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get uploadedAt => $composableBuilder( - column: $table.uploadedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get livePhotoVideoId => $composableBuilder( - column: $table.livePhotoVideoId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get visibility => $composableBuilder( - column: $table.visibility, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get stackId => $composableBuilder( - column: $table.stackId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get libraryId => $composableBuilder( - column: $table.libraryId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isEdited => $composableBuilder( - column: $table.isEdited, - builder: (column) => i0.ColumnFilters(column), - ); - - i5.$$UserEntityTableFilterComposer get ownerId { - final i5.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableFilterComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAssetEntityTableOrderingComposer - extends i0.Composer { - $$RemoteAssetEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get type => $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get checksum => $composableBuilder( - column: $table.checksum, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get localDateTime => $composableBuilder( - column: $table.localDateTime, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get thumbHash => $composableBuilder( - column: $table.thumbHash, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get deletedAt => $composableBuilder( - column: $table.deletedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get uploadedAt => $composableBuilder( - column: $table.uploadedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get livePhotoVideoId => $composableBuilder( - column: $table.livePhotoVideoId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get visibility => $composableBuilder( - column: $table.visibility, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get stackId => $composableBuilder( - column: $table.stackId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get libraryId => $composableBuilder( - column: $table.libraryId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isEdited => $composableBuilder( - column: $table.isEdited, - builder: (column) => i0.ColumnOrderings(column), - ); - - i5.$$UserEntityTableOrderingComposer get ownerId { - final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAssetEntityTableAnnotationComposer - extends i0.Composer { - $$RemoteAssetEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter get type => - $composableBuilder(column: $table.type, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get width => - $composableBuilder(column: $table.width, builder: (column) => column); - - i0.GeneratedColumn get height => - $composableBuilder(column: $table.height, builder: (column) => column); - - i0.GeneratedColumn get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => column, - ); - - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get checksum => - $composableBuilder(column: $table.checksum, builder: (column) => column); - - i0.GeneratedColumn get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => column, - ); - - i0.GeneratedColumn get localDateTime => $composableBuilder( - column: $table.localDateTime, - builder: (column) => column, - ); - - i0.GeneratedColumn get thumbHash => - $composableBuilder(column: $table.thumbHash, builder: (column) => column); - - i0.GeneratedColumn get deletedAt => - $composableBuilder(column: $table.deletedAt, builder: (column) => column); - - i0.GeneratedColumn get uploadedAt => $composableBuilder( - column: $table.uploadedAt, - builder: (column) => column, - ); - - i0.GeneratedColumn get livePhotoVideoId => $composableBuilder( - column: $table.livePhotoVideoId, - builder: (column) => column, - ); - - i0.GeneratedColumnWithTypeConverter get visibility => - $composableBuilder( - column: $table.visibility, - builder: (column) => column, - ); - - i0.GeneratedColumn get stackId => - $composableBuilder(column: $table.stackId, builder: (column) => column); - - i0.GeneratedColumn get libraryId => - $composableBuilder(column: $table.libraryId, builder: (column) => column); - - i0.GeneratedColumn get isEdited => - $composableBuilder(column: $table.isEdited, builder: (column) => column); - - i5.$$UserEntityTableAnnotationComposer get ownerId { - final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAssetEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$RemoteAssetEntityTable, - i1.RemoteAssetEntityData, - i1.$$RemoteAssetEntityTableFilterComposer, - i1.$$RemoteAssetEntityTableOrderingComposer, - i1.$$RemoteAssetEntityTableAnnotationComposer, - $$RemoteAssetEntityTableCreateCompanionBuilder, - $$RemoteAssetEntityTableUpdateCompanionBuilder, - (i1.RemoteAssetEntityData, i1.$$RemoteAssetEntityTableReferences), - i1.RemoteAssetEntityData, - i0.PrefetchHooks Function({bool ownerId}) - > { - $$RemoteAssetEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$RemoteAssetEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$RemoteAssetEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => i1 - .$$RemoteAssetEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$RemoteAssetEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value name = const i0.Value.absent(), - i0.Value type = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - i0.Value id = const i0.Value.absent(), - i0.Value checksum = const i0.Value.absent(), - i0.Value isFavorite = const i0.Value.absent(), - i0.Value ownerId = const i0.Value.absent(), - i0.Value localDateTime = const i0.Value.absent(), - i0.Value thumbHash = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - i0.Value uploadedAt = const i0.Value.absent(), - i0.Value livePhotoVideoId = const i0.Value.absent(), - i0.Value visibility = - const i0.Value.absent(), - i0.Value stackId = const i0.Value.absent(), - i0.Value libraryId = const i0.Value.absent(), - i0.Value isEdited = const i0.Value.absent(), - }) => i1.RemoteAssetEntityCompanion( - name: name, - type: type, - createdAt: createdAt, - updatedAt: updatedAt, - width: width, - height: height, - durationMs: durationMs, - id: id, - checksum: checksum, - isFavorite: isFavorite, - ownerId: ownerId, - localDateTime: localDateTime, - thumbHash: thumbHash, - deletedAt: deletedAt, - uploadedAt: uploadedAt, - livePhotoVideoId: livePhotoVideoId, - visibility: visibility, - stackId: stackId, - libraryId: libraryId, - isEdited: isEdited, - ), - createCompanionCallback: - ({ - required String name, - required i2.AssetType type, - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - required String id, - required String checksum, - i0.Value isFavorite = const i0.Value.absent(), - required String ownerId, - i0.Value localDateTime = const i0.Value.absent(), - i0.Value thumbHash = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - i0.Value uploadedAt = const i0.Value.absent(), - i0.Value livePhotoVideoId = const i0.Value.absent(), - required i2.AssetVisibility visibility, - i0.Value stackId = const i0.Value.absent(), - i0.Value libraryId = const i0.Value.absent(), - i0.Value isEdited = const i0.Value.absent(), - }) => i1.RemoteAssetEntityCompanion.insert( - name: name, - type: type, - createdAt: createdAt, - updatedAt: updatedAt, - width: width, - height: height, - durationMs: durationMs, - id: id, - checksum: checksum, - isFavorite: isFavorite, - ownerId: ownerId, - localDateTime: localDateTime, - thumbHash: thumbHash, - deletedAt: deletedAt, - uploadedAt: uploadedAt, - livePhotoVideoId: livePhotoVideoId, - visibility: visibility, - stackId: stackId, - libraryId: libraryId, - isEdited: isEdited, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$RemoteAssetEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({ownerId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (ownerId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.ownerId, - referencedTable: i1 - .$$RemoteAssetEntityTableReferences - ._ownerIdTable(db), - referencedColumn: i1 - .$$RemoteAssetEntityTableReferences - ._ownerIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$RemoteAssetEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$RemoteAssetEntityTable, - i1.RemoteAssetEntityData, - i1.$$RemoteAssetEntityTableFilterComposer, - i1.$$RemoteAssetEntityTableOrderingComposer, - i1.$$RemoteAssetEntityTableAnnotationComposer, - $$RemoteAssetEntityTableCreateCompanionBuilder, - $$RemoteAssetEntityTableUpdateCompanionBuilder, - (i1.RemoteAssetEntityData, i1.$$RemoteAssetEntityTableReferences), - i1.RemoteAssetEntityData, - i0.PrefetchHooks Function({bool ownerId}) - >; -i0.Index get uQRemoteAssetsOwnerChecksum => i0.Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', -); - -class $RemoteAssetEntityTable extends i3.RemoteAssetEntity - with i0.TableInfo<$RemoteAssetEntityTable, i1.RemoteAssetEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $RemoteAssetEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - late final i0.GeneratedColumnWithTypeConverter type = - i0.GeneratedColumn( - 'type', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter(i1.$RemoteAssetEntityTable.$convertertype); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _widthMeta = const i0.VerificationMeta( - 'width', - ); - @override - late final i0.GeneratedColumn width = i0.GeneratedColumn( - 'width', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _heightMeta = const i0.VerificationMeta( - 'height', - ); - @override - late final i0.GeneratedColumn height = i0.GeneratedColumn( - 'height', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _durationMsMeta = const i0.VerificationMeta( - 'durationMs', - ); - @override - late final i0.GeneratedColumn durationMs = i0.GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _checksumMeta = const i0.VerificationMeta( - 'checksum', - ); - @override - late final i0.GeneratedColumn checksum = i0.GeneratedColumn( - 'checksum', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _isFavoriteMeta = const i0.VerificationMeta( - 'isFavorite', - ); - @override - late final i0.GeneratedColumn isFavorite = i0.GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _ownerIdMeta = const i0.VerificationMeta( - 'ownerId', - ); - @override - late final i0.GeneratedColumn ownerId = i0.GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _localDateTimeMeta = - const i0.VerificationMeta('localDateTime'); - @override - late final i0.GeneratedColumn localDateTime = - i0.GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _thumbHashMeta = const i0.VerificationMeta( - 'thumbHash', - ); - @override - late final i0.GeneratedColumn thumbHash = i0.GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _deletedAtMeta = const i0.VerificationMeta( - 'deletedAt', - ); - @override - late final i0.GeneratedColumn deletedAt = - i0.GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _uploadedAtMeta = const i0.VerificationMeta( - 'uploadedAt', - ); - @override - late final i0.GeneratedColumn uploadedAt = - i0.GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _livePhotoVideoIdMeta = - const i0.VerificationMeta('livePhotoVideoId'); - @override - late final i0.GeneratedColumn livePhotoVideoId = - i0.GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - late final i0.GeneratedColumnWithTypeConverter - visibility = - i0.GeneratedColumn( - 'visibility', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$RemoteAssetEntityTable.$convertervisibility, - ); - static const i0.VerificationMeta _stackIdMeta = const i0.VerificationMeta( - 'stackId', - ); - @override - late final i0.GeneratedColumn stackId = i0.GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _libraryIdMeta = const i0.VerificationMeta( - 'libraryId', - ); - @override - late final i0.GeneratedColumn libraryId = i0.GeneratedColumn( - 'library_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _isEditedMeta = const i0.VerificationMeta( - 'isEdited', - ); - @override - late final i0.GeneratedColumn isEdited = i0.GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('width')) { - context.handle( - _widthMeta, - width.isAcceptableOrUnknown(data['width']!, _widthMeta), - ); - } - if (data.containsKey('height')) { - context.handle( - _heightMeta, - height.isAcceptableOrUnknown(data['height']!, _heightMeta), - ); - } - if (data.containsKey('duration_ms')) { - context.handle( - _durationMsMeta, - durationMs.isAcceptableOrUnknown(data['duration_ms']!, _durationMsMeta), - ); - } - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('checksum')) { - context.handle( - _checksumMeta, - checksum.isAcceptableOrUnknown(data['checksum']!, _checksumMeta), - ); - } else if (isInserting) { - context.missing(_checksumMeta); - } - if (data.containsKey('is_favorite')) { - context.handle( - _isFavoriteMeta, - isFavorite.isAcceptableOrUnknown(data['is_favorite']!, _isFavoriteMeta), - ); - } - if (data.containsKey('owner_id')) { - context.handle( - _ownerIdMeta, - ownerId.isAcceptableOrUnknown(data['owner_id']!, _ownerIdMeta), - ); - } else if (isInserting) { - context.missing(_ownerIdMeta); - } - if (data.containsKey('local_date_time')) { - context.handle( - _localDateTimeMeta, - localDateTime.isAcceptableOrUnknown( - data['local_date_time']!, - _localDateTimeMeta, - ), - ); - } - if (data.containsKey('thumb_hash')) { - context.handle( - _thumbHashMeta, - thumbHash.isAcceptableOrUnknown(data['thumb_hash']!, _thumbHashMeta), - ); - } - if (data.containsKey('deleted_at')) { - context.handle( - _deletedAtMeta, - deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta), - ); - } - if (data.containsKey('uploaded_at')) { - context.handle( - _uploadedAtMeta, - uploadedAt.isAcceptableOrUnknown(data['uploaded_at']!, _uploadedAtMeta), - ); - } - if (data.containsKey('live_photo_video_id')) { - context.handle( - _livePhotoVideoIdMeta, - livePhotoVideoId.isAcceptableOrUnknown( - data['live_photo_video_id']!, - _livePhotoVideoIdMeta, - ), - ); - } - if (data.containsKey('stack_id')) { - context.handle( - _stackIdMeta, - stackId.isAcceptableOrUnknown(data['stack_id']!, _stackIdMeta), - ); - } - if (data.containsKey('library_id')) { - context.handle( - _libraryIdMeta, - libraryId.isAcceptableOrUnknown(data['library_id']!, _libraryIdMeta), - ); - } - if (data.containsKey('is_edited')) { - context.handle( - _isEditedMeta, - isEdited.isAcceptableOrUnknown(data['is_edited']!, _isEditedMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.RemoteAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: i1.$RemoteAssetEntityTable.$convertertype.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - ), - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: i1.$RemoteAssetEntityTable.$convertervisibility.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - ), - stackId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - $RemoteAssetEntityTable createAlias(String alias) { - return $RemoteAssetEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $convertertype = - const i0.EnumIndexConverter(i2.AssetType.values); - static i0.JsonTypeConverter2 - $convertervisibility = const i0.EnumIndexConverter( - i2.AssetVisibility.values, - ); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends i0.DataClass - implements i0.Insertable { - final String name; - final i2.AssetType type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final DateTime? uploadedAt; - final String? livePhotoVideoId; - final i2.AssetVisibility visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = i0.Variable(name); - { - map['type'] = i0.Variable( - i1.$RemoteAssetEntityTable.$convertertype.toSql(type), - ); - } - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = i0.Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = i0.Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = i0.Variable(durationMs); - } - map['id'] = i0.Variable(id); - map['checksum'] = i0.Variable(checksum); - map['is_favorite'] = i0.Variable(isFavorite); - map['owner_id'] = i0.Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = i0.Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = i0.Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = i0.Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = i0.Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = i0.Variable(livePhotoVideoId); - } - { - map['visibility'] = i0.Variable( - i1.$RemoteAssetEntityTable.$convertervisibility.toSql(visibility), - ); - } - if (!nullToAbsent || stackId != null) { - map['stack_id'] = i0.Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = i0.Variable(libraryId); - } - map['is_edited'] = i0.Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: i1.$RemoteAssetEntityTable.$convertertype.fromJson( - serializer.fromJson(json['type']), - ), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: i1.$RemoteAssetEntityTable.$convertervisibility.fromJson( - serializer.fromJson(json['visibility']), - ), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson( - i1.$RemoteAssetEntityTable.$convertertype.toJson(type), - ), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson( - i1.$RemoteAssetEntityTable.$convertervisibility.toJson(visibility), - ), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - i1.RemoteAssetEntityData copyWith({ - String? name, - i2.AssetType? type, - DateTime? createdAt, - DateTime? updatedAt, - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - i0.Value localDateTime = const i0.Value.absent(), - i0.Value thumbHash = const i0.Value.absent(), - i0.Value deletedAt = const i0.Value.absent(), - i0.Value uploadedAt = const i0.Value.absent(), - i0.Value livePhotoVideoId = const i0.Value.absent(), - i2.AssetVisibility? visibility, - i0.Value stackId = const i0.Value.absent(), - i0.Value libraryId = const i0.Value.absent(), - bool? isEdited, - }) => i1.RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(i1.RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends i0.UpdateCompanion { - final i0.Value name; - final i0.Value type; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value width; - final i0.Value height; - final i0.Value durationMs; - final i0.Value id; - final i0.Value checksum; - final i0.Value isFavorite; - final i0.Value ownerId; - final i0.Value localDateTime; - final i0.Value thumbHash; - final i0.Value deletedAt; - final i0.Value uploadedAt; - final i0.Value livePhotoVideoId; - final i0.Value visibility; - final i0.Value stackId; - final i0.Value libraryId; - final i0.Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const i0.Value.absent(), - this.type = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.durationMs = const i0.Value.absent(), - this.id = const i0.Value.absent(), - this.checksum = const i0.Value.absent(), - this.isFavorite = const i0.Value.absent(), - this.ownerId = const i0.Value.absent(), - this.localDateTime = const i0.Value.absent(), - this.thumbHash = const i0.Value.absent(), - this.deletedAt = const i0.Value.absent(), - this.uploadedAt = const i0.Value.absent(), - this.livePhotoVideoId = const i0.Value.absent(), - this.visibility = const i0.Value.absent(), - this.stackId = const i0.Value.absent(), - this.libraryId = const i0.Value.absent(), - this.isEdited = const i0.Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required i2.AssetType type, - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.durationMs = const i0.Value.absent(), - required String id, - required String checksum, - this.isFavorite = const i0.Value.absent(), - required String ownerId, - this.localDateTime = const i0.Value.absent(), - this.thumbHash = const i0.Value.absent(), - this.deletedAt = const i0.Value.absent(), - this.uploadedAt = const i0.Value.absent(), - this.livePhotoVideoId = const i0.Value.absent(), - required i2.AssetVisibility visibility, - this.stackId = const i0.Value.absent(), - this.libraryId = const i0.Value.absent(), - this.isEdited = const i0.Value.absent(), - }) : name = i0.Value(name), - type = i0.Value(type), - id = i0.Value(id), - checksum = i0.Value(checksum), - ownerId = i0.Value(ownerId), - visibility = i0.Value(visibility); - static i0.Insertable custom({ - i0.Expression? name, - i0.Expression? type, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? width, - i0.Expression? height, - i0.Expression? durationMs, - i0.Expression? id, - i0.Expression? checksum, - i0.Expression? isFavorite, - i0.Expression? ownerId, - i0.Expression? localDateTime, - i0.Expression? thumbHash, - i0.Expression? deletedAt, - i0.Expression? uploadedAt, - i0.Expression? livePhotoVideoId, - i0.Expression? visibility, - i0.Expression? stackId, - i0.Expression? libraryId, - i0.Expression? isEdited, - }) { - return i0.RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - i1.RemoteAssetEntityCompanion copyWith({ - i0.Value? name, - i0.Value? type, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? width, - i0.Value? height, - i0.Value? durationMs, - i0.Value? id, - i0.Value? checksum, - i0.Value? isFavorite, - i0.Value? ownerId, - i0.Value? localDateTime, - i0.Value? thumbHash, - i0.Value? deletedAt, - i0.Value? uploadedAt, - i0.Value? livePhotoVideoId, - i0.Value? visibility, - i0.Value? stackId, - i0.Value? libraryId, - i0.Value? isEdited, - }) { - return i1.RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (type.present) { - map['type'] = i0.Variable( - i1.$RemoteAssetEntityTable.$convertertype.toSql(type.value), - ); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (width.present) { - map['width'] = i0.Variable(width.value); - } - if (height.present) { - map['height'] = i0.Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = i0.Variable(durationMs.value); - } - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (checksum.present) { - map['checksum'] = i0.Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = i0.Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = i0.Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = i0.Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = i0.Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = i0.Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = i0.Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = i0.Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = i0.Variable( - i1.$RemoteAssetEntityTable.$convertervisibility.toSql(visibility.value), - ); - } - if (stackId.present) { - map['stack_id'] = i0.Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = i0.Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = i0.Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -i0.Index get uQRemoteAssetsOwnerLibraryChecksum => i0.Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', -); -i0.Index get idxRemoteAssetChecksum => i0.Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', -); -i0.Index get idxRemoteAssetStackId => i0.Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', -); -i0.Index get idxRemoteAssetOwnerVisibilityDeletedCreated => i0.Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', -); -i0.Index get idxRemoteAssetUploaded => i0.Index( - 'idx_remote_asset_uploaded', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_uploaded ON remote_asset_entity (uploaded_at)', -); diff --git a/mobile/lib/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart deleted file mode 100644 index 6a7a8d176c..0000000000 --- a/mobile/lib/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart +++ /dev/null @@ -1,821 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/remote_asset_cloud_id.entity.dart' - as i2; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i3; -import 'package:drift/internal/modular.dart' as i4; - -typedef $$RemoteAssetCloudIdEntityTableCreateCompanionBuilder = - i1.RemoteAssetCloudIdEntityCompanion Function({ - required String assetId, - i0.Value cloudId, - i0.Value createdAt, - i0.Value adjustmentTime, - i0.Value latitude, - i0.Value longitude, - }); -typedef $$RemoteAssetCloudIdEntityTableUpdateCompanionBuilder = - i1.RemoteAssetCloudIdEntityCompanion Function({ - i0.Value assetId, - i0.Value cloudId, - i0.Value createdAt, - i0.Value adjustmentTime, - i0.Value latitude, - i0.Value longitude, - }); - -final class $$RemoteAssetCloudIdEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$RemoteAssetCloudIdEntityTable, - i1.RemoteAssetCloudIdEntityData - > { - $$RemoteAssetCloudIdEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) => - i4.ReadDatabaseContainer(db) - .resultSet('remote_asset_entity') - .createAlias( - 'remote_asset_cloud_id_entity__asset_id__remote_asset_entity__id', - ); - - i3.$$RemoteAssetEntityTableProcessedTableManager get assetId { - final $_column = $_itemColumn('asset_id')!; - - final manager = i3 - .$$RemoteAssetEntityTableTableManager( - $_db, - i4.ReadDatabaseContainer( - $_db, - ).resultSet('remote_asset_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_assetIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$RemoteAssetCloudIdEntityTableFilterComposer - extends - i0.Composer { - $$RemoteAssetCloudIdEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get cloudId => $composableBuilder( - column: $table.cloudId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get adjustmentTime => $composableBuilder( - column: $table.adjustmentTime, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get latitude => $composableBuilder( - column: $table.latitude, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get longitude => $composableBuilder( - column: $table.longitude, - builder: (column) => i0.ColumnFilters(column), - ); - - i3.$$RemoteAssetEntityTableFilterComposer get assetId { - final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableFilterComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAssetCloudIdEntityTableOrderingComposer - extends - i0.Composer { - $$RemoteAssetCloudIdEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get cloudId => $composableBuilder( - column: $table.cloudId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get adjustmentTime => $composableBuilder( - column: $table.adjustmentTime, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get latitude => $composableBuilder( - column: $table.latitude, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get longitude => $composableBuilder( - column: $table.longitude, - builder: (column) => i0.ColumnOrderings(column), - ); - - i3.$$RemoteAssetEntityTableOrderingComposer get assetId { - final i3.$$RemoteAssetEntityTableOrderingComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableOrderingComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAssetCloudIdEntityTableAnnotationComposer - extends - i0.Composer { - $$RemoteAssetCloudIdEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get cloudId => - $composableBuilder(column: $table.cloudId, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get adjustmentTime => $composableBuilder( - column: $table.adjustmentTime, - builder: (column) => column, - ); - - i0.GeneratedColumn get latitude => - $composableBuilder(column: $table.latitude, builder: (column) => column); - - i0.GeneratedColumn get longitude => - $composableBuilder(column: $table.longitude, builder: (column) => column); - - i3.$$RemoteAssetEntityTableAnnotationComposer get assetId { - final i3.$$RemoteAssetEntityTableAnnotationComposer composer = - $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.assetId, - referencedTable: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i3.$$RemoteAssetEntityTableAnnotationComposer( - $db: $db, - $table: i4.ReadDatabaseContainer( - $db, - ).resultSet('remote_asset_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$RemoteAssetCloudIdEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$RemoteAssetCloudIdEntityTable, - i1.RemoteAssetCloudIdEntityData, - i1.$$RemoteAssetCloudIdEntityTableFilterComposer, - i1.$$RemoteAssetCloudIdEntityTableOrderingComposer, - i1.$$RemoteAssetCloudIdEntityTableAnnotationComposer, - $$RemoteAssetCloudIdEntityTableCreateCompanionBuilder, - $$RemoteAssetCloudIdEntityTableUpdateCompanionBuilder, - ( - i1.RemoteAssetCloudIdEntityData, - i1.$$RemoteAssetCloudIdEntityTableReferences, - ), - i1.RemoteAssetCloudIdEntityData, - i0.PrefetchHooks Function({bool assetId}) - > { - $$RemoteAssetCloudIdEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$RemoteAssetCloudIdEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$RemoteAssetCloudIdEntityTableFilterComposer( - $db: db, - $table: table, - ), - createOrderingComposer: () => - i1.$$RemoteAssetCloudIdEntityTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - i1.$$RemoteAssetCloudIdEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value assetId = const i0.Value.absent(), - i0.Value cloudId = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value adjustmentTime = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - }) => i1.RemoteAssetCloudIdEntityCompanion( - assetId: assetId, - cloudId: cloudId, - createdAt: createdAt, - adjustmentTime: adjustmentTime, - latitude: latitude, - longitude: longitude, - ), - createCompanionCallback: - ({ - required String assetId, - i0.Value cloudId = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value adjustmentTime = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - }) => i1.RemoteAssetCloudIdEntityCompanion.insert( - assetId: assetId, - cloudId: cloudId, - createdAt: createdAt, - adjustmentTime: adjustmentTime, - latitude: latitude, - longitude: longitude, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$RemoteAssetCloudIdEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({assetId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (assetId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.assetId, - referencedTable: i1 - .$$RemoteAssetCloudIdEntityTableReferences - ._assetIdTable(db), - referencedColumn: i1 - .$$RemoteAssetCloudIdEntityTableReferences - ._assetIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$RemoteAssetCloudIdEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$RemoteAssetCloudIdEntityTable, - i1.RemoteAssetCloudIdEntityData, - i1.$$RemoteAssetCloudIdEntityTableFilterComposer, - i1.$$RemoteAssetCloudIdEntityTableOrderingComposer, - i1.$$RemoteAssetCloudIdEntityTableAnnotationComposer, - $$RemoteAssetCloudIdEntityTableCreateCompanionBuilder, - $$RemoteAssetCloudIdEntityTableUpdateCompanionBuilder, - ( - i1.RemoteAssetCloudIdEntityData, - i1.$$RemoteAssetCloudIdEntityTableReferences, - ), - i1.RemoteAssetCloudIdEntityData, - i0.PrefetchHooks Function({bool assetId}) - >; -i0.Index get idxRemoteAssetCloudId => i0.Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', -); - -class $RemoteAssetCloudIdEntityTable extends i2.RemoteAssetCloudIdEntity - with - i0.TableInfo< - $RemoteAssetCloudIdEntityTable, - i1.RemoteAssetCloudIdEntityData - > { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $RemoteAssetCloudIdEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta( - 'assetId', - ); - @override - late final i0.GeneratedColumn assetId = i0.GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _cloudIdMeta = const i0.VerificationMeta( - 'cloudId', - ); - @override - late final i0.GeneratedColumn cloudId = i0.GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _adjustmentTimeMeta = - const i0.VerificationMeta('adjustmentTime'); - @override - late final i0.GeneratedColumn adjustmentTime = - i0.GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _latitudeMeta = const i0.VerificationMeta( - 'latitude', - ); - @override - late final i0.GeneratedColumn latitude = i0.GeneratedColumn( - 'latitude', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _longitudeMeta = const i0.VerificationMeta( - 'longitude', - ); - @override - late final i0.GeneratedColumn longitude = i0.GeneratedColumn( - 'longitude', - aliasedName, - true, - type: i0.DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('asset_id')) { - context.handle( - _assetIdMeta, - assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta), - ); - } else if (isInserting) { - context.missing(_assetIdMeta); - } - if (data.containsKey('cloud_id')) { - context.handle( - _cloudIdMeta, - cloudId.isAcceptableOrUnknown(data['cloud_id']!, _cloudIdMeta), - ); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('adjustment_time')) { - context.handle( - _adjustmentTimeMeta, - adjustmentTime.isAcceptableOrUnknown( - data['adjustment_time']!, - _adjustmentTimeMeta, - ), - ); - } - if (data.containsKey('latitude')) { - context.handle( - _latitudeMeta, - latitude.isAcceptableOrUnknown(data['latitude']!, _latitudeMeta), - ); - } - if (data.containsKey('longitude')) { - context.handle( - _longitudeMeta, - longitude.isAcceptableOrUnknown(data['longitude']!, _longitudeMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {assetId}; - @override - i1.RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - i0.DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - $RemoteAssetCloudIdEntityTable createAlias(String alias) { - return $RemoteAssetCloudIdEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends i0.DataClass - implements i0.Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = i0.Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = i0.Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = i0.Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = i0.Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = i0.Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = i0.Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - i1.RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - i0.Value cloudId = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value adjustmentTime = const i0.Value.absent(), - i0.Value latitude = const i0.Value.absent(), - i0.Value longitude = const i0.Value.absent(), - }) => i1.RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - i1.RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends i0.UpdateCompanion { - final i0.Value assetId; - final i0.Value cloudId; - final i0.Value createdAt; - final i0.Value adjustmentTime; - final i0.Value latitude; - final i0.Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const i0.Value.absent(), - this.cloudId = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.adjustmentTime = const i0.Value.absent(), - this.latitude = const i0.Value.absent(), - this.longitude = const i0.Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.adjustmentTime = const i0.Value.absent(), - this.latitude = const i0.Value.absent(), - this.longitude = const i0.Value.absent(), - }) : assetId = i0.Value(assetId); - static i0.Insertable custom({ - i0.Expression? assetId, - i0.Expression? cloudId, - i0.Expression? createdAt, - i0.Expression? adjustmentTime, - i0.Expression? latitude, - i0.Expression? longitude, - }) { - return i0.RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - i1.RemoteAssetCloudIdEntityCompanion copyWith({ - i0.Value? assetId, - i0.Value? cloudId, - i0.Value? createdAt, - i0.Value? adjustmentTime, - i0.Value? latitude, - i0.Value? longitude, - }) { - return i1.RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = i0.Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = i0.Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = i0.Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = i0.Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = i0.Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/settings.entity.drift.dart b/mobile/lib/infrastructure/entities/settings.entity.drift.dart deleted file mode 100644 index 7b0fc00ea6..0000000000 --- a/mobile/lib/infrastructure/entities/settings.entity.drift.dart +++ /dev/null @@ -1,428 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/settings.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/settings.entity.dart' - as i2; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3; - -typedef $$SettingsEntityTableCreateCompanionBuilder = - i1.SettingsEntityCompanion Function({ - required String key, - i0.Value value, - i0.Value updatedAt, - }); -typedef $$SettingsEntityTableUpdateCompanionBuilder = - i1.SettingsEntityCompanion Function({ - i0.Value key, - i0.Value value, - i0.Value updatedAt, - }); - -class $$SettingsEntityTableFilterComposer - extends i0.Composer { - $$SettingsEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get key => $composableBuilder( - column: $table.key, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get value => $composableBuilder( - column: $table.value, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); -} - -class $$SettingsEntityTableOrderingComposer - extends i0.Composer { - $$SettingsEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get key => $composableBuilder( - column: $table.key, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get value => $composableBuilder( - column: $table.value, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$SettingsEntityTableAnnotationComposer - extends i0.Composer { - $$SettingsEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get key => - $composableBuilder(column: $table.key, builder: (column) => column); - - i0.GeneratedColumn get value => - $composableBuilder(column: $table.value, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); -} - -class $$SettingsEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$SettingsEntityTable, - i1.SettingsEntityData, - i1.$$SettingsEntityTableFilterComposer, - i1.$$SettingsEntityTableOrderingComposer, - i1.$$SettingsEntityTableAnnotationComposer, - $$SettingsEntityTableCreateCompanionBuilder, - $$SettingsEntityTableUpdateCompanionBuilder, - ( - i1.SettingsEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$SettingsEntityTable, - i1.SettingsEntityData - >, - ), - i1.SettingsEntityData, - i0.PrefetchHooks Function() - > { - $$SettingsEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$SettingsEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$SettingsEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$SettingsEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => i1 - .$$SettingsEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value key = const i0.Value.absent(), - i0.Value value = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - }) => i1.SettingsEntityCompanion( - key: key, - value: value, - updatedAt: updatedAt, - ), - createCompanionCallback: - ({ - required String key, - i0.Value value = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - }) => i1.SettingsEntityCompanion.insert( - key: key, - value: value, - updatedAt: updatedAt, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$SettingsEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$SettingsEntityTable, - i1.SettingsEntityData, - i1.$$SettingsEntityTableFilterComposer, - i1.$$SettingsEntityTableOrderingComposer, - i1.$$SettingsEntityTableAnnotationComposer, - $$SettingsEntityTableCreateCompanionBuilder, - $$SettingsEntityTableUpdateCompanionBuilder, - ( - i1.SettingsEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$SettingsEntityTable, - i1.SettingsEntityData - >, - ), - i1.SettingsEntityData, - i0.PrefetchHooks Function() - >; - -class $SettingsEntityTable extends i2.SettingsEntity - with i0.TableInfo<$SettingsEntityTable, i1.SettingsEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $SettingsEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _keyMeta = const i0.VerificationMeta('key'); - @override - late final i0.GeneratedColumn key = i0.GeneratedColumn( - 'key', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _valueMeta = const i0.VerificationMeta( - 'value', - ); - @override - late final i0.GeneratedColumn value = i0.GeneratedColumn( - 'value', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i3.currentDateAndTime, - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'settings'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('key')) { - context.handle( - _keyMeta, - key.isAcceptableOrUnknown(data['key']!, _keyMeta), - ); - } else if (isInserting) { - context.missing(_keyMeta); - } - if (data.containsKey('value')) { - context.handle( - _valueMeta, - value.isAcceptableOrUnknown(data['value']!, _valueMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {key}; - @override - i1.SettingsEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.SettingsEntityData( - key: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}value'], - ), - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - $SettingsEntityTable createAlias(String alias) { - return $SettingsEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class SettingsEntityData extends i0.DataClass - implements i0.Insertable { - final String key; - final String? value; - final DateTime updatedAt; - const SettingsEntityData({ - required this.key, - this.value, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = i0.Variable(key); - if (!nullToAbsent || value != null) { - map['value'] = i0.Variable(value); - } - map['updated_at'] = i0.Variable(updatedAt); - return map; - } - - factory SettingsEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return SettingsEntityData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - i1.SettingsEntityData copyWith({ - String? key, - i0.Value value = const i0.Value.absent(), - DateTime? updatedAt, - }) => i1.SettingsEntityData( - key: key ?? this.key, - value: value.present ? value.value : this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - SettingsEntityData copyWithCompanion(i1.SettingsEntityCompanion data) { - return SettingsEntityData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('SettingsEntityData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.SettingsEntityData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class SettingsEntityCompanion - extends i0.UpdateCompanion { - final i0.Value key; - final i0.Value value; - final i0.Value updatedAt; - const SettingsEntityCompanion({ - this.key = const i0.Value.absent(), - this.value = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - }); - SettingsEntityCompanion.insert({ - required String key, - this.value = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - }) : key = i0.Value(key); - static i0.Insertable custom({ - i0.Expression? key, - i0.Expression? value, - i0.Expression? updatedAt, - }) { - return i0.RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - i1.SettingsEntityCompanion copyWith({ - i0.Value? key, - i0.Value? value, - i0.Value? updatedAt, - }) { - return i1.SettingsEntityCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = i0.Variable(key.value); - } - if (value.present) { - map['value'] = i0.Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingsEntityCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/stack.entity.drift.dart b/mobile/lib/infrastructure/entities/stack.entity.drift.dart deleted file mode 100644 index 7846ca9374..0000000000 --- a/mobile/lib/infrastructure/entities/stack.entity.drift.dart +++ /dev/null @@ -1,708 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/stack.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/stack.entity.dart' as i2; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i4; -import 'package:drift/internal/modular.dart' as i5; - -typedef $$StackEntityTableCreateCompanionBuilder = - i1.StackEntityCompanion Function({ - required String id, - i0.Value createdAt, - i0.Value updatedAt, - required String ownerId, - required String primaryAssetId, - }); -typedef $$StackEntityTableUpdateCompanionBuilder = - i1.StackEntityCompanion Function({ - i0.Value id, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value ownerId, - i0.Value primaryAssetId, - }); - -final class $$StackEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$StackEntityTable, - i1.StackEntityData - > { - $$StackEntityTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static i4.$UserEntityTable _ownerIdTable(i0.GeneratedDatabase db) => - i5.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('stack_entity__owner_id__user_entity__id'); - - i4.$$UserEntityTableProcessedTableManager get ownerId { - final $_column = $_itemColumn('owner_id')!; - - final manager = i4 - .$$UserEntityTableTableManager( - $_db, - i5.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_ownerIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$StackEntityTableFilterComposer - extends i0.Composer { - $$StackEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get primaryAssetId => $composableBuilder( - column: $table.primaryAssetId, - builder: (column) => i0.ColumnFilters(column), - ); - - i4.$$UserEntityTableFilterComposer get ownerId { - final i4.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableFilterComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$StackEntityTableOrderingComposer - extends i0.Composer { - $$StackEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get primaryAssetId => $composableBuilder( - column: $table.primaryAssetId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i4.$$UserEntityTableOrderingComposer get ownerId { - final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$StackEntityTableAnnotationComposer - extends i0.Composer { - $$StackEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get primaryAssetId => $composableBuilder( - column: $table.primaryAssetId, - builder: (column) => column, - ); - - i4.$$UserEntityTableAnnotationComposer get ownerId { - final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.ownerId, - referencedTable: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i4.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i5.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$StackEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$StackEntityTable, - i1.StackEntityData, - i1.$$StackEntityTableFilterComposer, - i1.$$StackEntityTableOrderingComposer, - i1.$$StackEntityTableAnnotationComposer, - $$StackEntityTableCreateCompanionBuilder, - $$StackEntityTableUpdateCompanionBuilder, - (i1.StackEntityData, i1.$$StackEntityTableReferences), - i1.StackEntityData, - i0.PrefetchHooks Function({bool ownerId}) - > { - $$StackEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$StackEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$StackEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$StackEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$StackEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value ownerId = const i0.Value.absent(), - i0.Value primaryAssetId = const i0.Value.absent(), - }) => i1.StackEntityCompanion( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - ownerId: ownerId, - primaryAssetId: primaryAssetId, - ), - createCompanionCallback: - ({ - required String id, - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - required String ownerId, - required String primaryAssetId, - }) => i1.StackEntityCompanion.insert( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - ownerId: ownerId, - primaryAssetId: primaryAssetId, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$StackEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({ownerId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (ownerId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.ownerId, - referencedTable: i1.$$StackEntityTableReferences - ._ownerIdTable(db), - referencedColumn: i1 - .$$StackEntityTableReferences - ._ownerIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$StackEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$StackEntityTable, - i1.StackEntityData, - i1.$$StackEntityTableFilterComposer, - i1.$$StackEntityTableOrderingComposer, - i1.$$StackEntityTableAnnotationComposer, - $$StackEntityTableCreateCompanionBuilder, - $$StackEntityTableUpdateCompanionBuilder, - (i1.StackEntityData, i1.$$StackEntityTableReferences), - i1.StackEntityData, - i0.PrefetchHooks Function({bool ownerId}) - >; -i0.Index get idxStackPrimaryAssetId => i0.Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', -); - -class $StackEntityTable extends i2.StackEntity - with i0.TableInfo<$StackEntityTable, i1.StackEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $StackEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i3.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i3.currentDateAndTime, - ); - static const i0.VerificationMeta _ownerIdMeta = const i0.VerificationMeta( - 'ownerId', - ); - @override - late final i0.GeneratedColumn ownerId = i0.GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - static const i0.VerificationMeta _primaryAssetIdMeta = - const i0.VerificationMeta('primaryAssetId'); - @override - late final i0.GeneratedColumn primaryAssetId = - i0.GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('owner_id')) { - context.handle( - _ownerIdMeta, - ownerId.isAcceptableOrUnknown(data['owner_id']!, _ownerIdMeta), - ); - } else if (isInserting) { - context.missing(_ownerIdMeta); - } - if (data.containsKey('primary_asset_id')) { - context.handle( - _primaryAssetIdMeta, - primaryAssetId.isAcceptableOrUnknown( - data['primary_asset_id']!, - _primaryAssetIdMeta, - ), - ); - } else if (isInserting) { - context.missing(_primaryAssetIdMeta); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.StackEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - $StackEntityTable createAlias(String alias) { - return $StackEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - map['owner_id'] = i0.Variable(ownerId); - map['primary_asset_id'] = i0.Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - i1.StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => i1.StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(i1.StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value ownerId; - final i0.Value primaryAssetId; - const StackEntityCompanion({ - this.id = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.ownerId = const i0.Value.absent(), - this.primaryAssetId = const i0.Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = i0.Value(id), - ownerId = i0.Value(ownerId), - primaryAssetId = i0.Value(primaryAssetId); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? ownerId, - i0.Expression? primaryAssetId, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - i1.StackEntityCompanion copyWith({ - i0.Value? id, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? ownerId, - i0.Value? primaryAssetId, - }) { - return i1.StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = i0.Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = i0.Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/store.entity.drift.dart b/mobile/lib/infrastructure/entities/store.entity.drift.dart deleted file mode 100644 index 327b0e95d9..0000000000 --- a/mobile/lib/infrastructure/entities/store.entity.drift.dart +++ /dev/null @@ -1,426 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/store.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/store.entity.dart' as i2; - -typedef $$StoreEntityTableCreateCompanionBuilder = - i1.StoreEntityCompanion Function({ - required int id, - i0.Value stringValue, - i0.Value intValue, - }); -typedef $$StoreEntityTableUpdateCompanionBuilder = - i1.StoreEntityCompanion Function({ - i0.Value id, - i0.Value stringValue, - i0.Value intValue, - }); - -class $$StoreEntityTableFilterComposer - extends i0.Composer { - $$StoreEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get stringValue => $composableBuilder( - column: $table.stringValue, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get intValue => $composableBuilder( - column: $table.intValue, - builder: (column) => i0.ColumnFilters(column), - ); -} - -class $$StoreEntityTableOrderingComposer - extends i0.Composer { - $$StoreEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get stringValue => $composableBuilder( - column: $table.stringValue, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get intValue => $composableBuilder( - column: $table.intValue, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$StoreEntityTableAnnotationComposer - extends i0.Composer { - $$StoreEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get stringValue => $composableBuilder( - column: $table.stringValue, - builder: (column) => column, - ); - - i0.GeneratedColumn get intValue => - $composableBuilder(column: $table.intValue, builder: (column) => column); -} - -class $$StoreEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$StoreEntityTable, - i1.StoreEntityData, - i1.$$StoreEntityTableFilterComposer, - i1.$$StoreEntityTableOrderingComposer, - i1.$$StoreEntityTableAnnotationComposer, - $$StoreEntityTableCreateCompanionBuilder, - $$StoreEntityTableUpdateCompanionBuilder, - ( - i1.StoreEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$StoreEntityTable, - i1.StoreEntityData - >, - ), - i1.StoreEntityData, - i0.PrefetchHooks Function() - > { - $$StoreEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$StoreEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$StoreEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$StoreEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$StoreEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value stringValue = const i0.Value.absent(), - i0.Value intValue = const i0.Value.absent(), - }) => i1.StoreEntityCompanion( - id: id, - stringValue: stringValue, - intValue: intValue, - ), - createCompanionCallback: - ({ - required int id, - i0.Value stringValue = const i0.Value.absent(), - i0.Value intValue = const i0.Value.absent(), - }) => i1.StoreEntityCompanion.insert( - id: id, - stringValue: stringValue, - intValue: intValue, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$StoreEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$StoreEntityTable, - i1.StoreEntityData, - i1.$$StoreEntityTableFilterComposer, - i1.$$StoreEntityTableOrderingComposer, - i1.$$StoreEntityTableAnnotationComposer, - $$StoreEntityTableCreateCompanionBuilder, - $$StoreEntityTableUpdateCompanionBuilder, - ( - i1.StoreEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$StoreEntityTable, - i1.StoreEntityData - >, - ), - i1.StoreEntityData, - i0.PrefetchHooks Function() - >; - -class $StoreEntityTable extends i2.StoreEntity - with i0.TableInfo<$StoreEntityTable, i1.StoreEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $StoreEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _stringValueMeta = const i0.VerificationMeta( - 'stringValue', - ); - @override - late final i0.GeneratedColumn stringValue = - i0.GeneratedColumn( - 'string_value', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _intValueMeta = const i0.VerificationMeta( - 'intValue', - ); - @override - late final i0.GeneratedColumn intValue = i0.GeneratedColumn( - 'int_value', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('string_value')) { - context.handle( - _stringValueMeta, - stringValue.isAcceptableOrUnknown( - data['string_value']!, - _stringValueMeta, - ), - ); - } - if (data.containsKey('int_value')) { - context.handle( - _intValueMeta, - intValue.isAcceptableOrUnknown(data['int_value']!, _intValueMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.StoreEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - $StoreEntityTable createAlias(String alias) { - return $StoreEntityTable(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends i0.DataClass - implements i0.Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = i0.Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = i0.Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - i1.StoreEntityData copyWith({ - int? id, - i0.Value stringValue = const i0.Value.absent(), - i0.Value intValue = const i0.Value.absent(), - }) => i1.StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(i1.StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value stringValue; - final i0.Value intValue; - const StoreEntityCompanion({ - this.id = const i0.Value.absent(), - this.stringValue = const i0.Value.absent(), - this.intValue = const i0.Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const i0.Value.absent(), - this.intValue = const i0.Value.absent(), - }) : id = i0.Value(id); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? stringValue, - i0.Expression? intValue, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - i1.StoreEntityCompanion copyWith({ - i0.Value? id, - i0.Value? stringValue, - i0.Value? intValue, - }) { - return i1.StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = i0.Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = i0.Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/trashed_local_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.drift.dart deleted file mode 100644 index 068d008e92..0000000000 --- a/mobile/lib/infrastructure/entities/trashed_local_asset.entity.drift.dart +++ /dev/null @@ -1,1241 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/trashed_local_asset.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/asset/base_asset.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/trashed_local_asset.entity.dart' - as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; - -typedef $$TrashedLocalAssetEntityTableCreateCompanionBuilder = - i1.TrashedLocalAssetEntityCompanion Function({ - required String name, - required i2.AssetType type, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value width, - i0.Value height, - i0.Value durationMs, - required String id, - required String albumId, - i0.Value checksum, - i0.Value isFavorite, - i0.Value orientation, - required i3.TrashOrigin source, - i0.Value playbackStyle, - }); -typedef $$TrashedLocalAssetEntityTableUpdateCompanionBuilder = - i1.TrashedLocalAssetEntityCompanion Function({ - i0.Value name, - i0.Value type, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value width, - i0.Value height, - i0.Value durationMs, - i0.Value id, - i0.Value albumId, - i0.Value checksum, - i0.Value isFavorite, - i0.Value orientation, - i0.Value source, - i0.Value playbackStyle, - }); - -class $$TrashedLocalAssetEntityTableFilterComposer - extends - i0.Composer { - $$TrashedLocalAssetEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters get type => - $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get albumId => $composableBuilder( - column: $table.albumId, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get checksum => $composableBuilder( - column: $table.checksum, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get source => $composableBuilder( - column: $table.source, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnWithTypeConverterFilters< - i2.AssetPlaybackStyle, - i2.AssetPlaybackStyle, - int - > - get playbackStyle => $composableBuilder( - column: $table.playbackStyle, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); -} - -class $$TrashedLocalAssetEntityTableOrderingComposer - extends - i0.Composer { - $$TrashedLocalAssetEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get type => $composableBuilder( - column: $table.type, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get width => $composableBuilder( - column: $table.width, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get height => $composableBuilder( - column: $table.height, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get albumId => $composableBuilder( - column: $table.albumId, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get checksum => $composableBuilder( - column: $table.checksum, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get source => $composableBuilder( - column: $table.source, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get playbackStyle => $composableBuilder( - column: $table.playbackStyle, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$TrashedLocalAssetEntityTableAnnotationComposer - extends - i0.Composer { - $$TrashedLocalAssetEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter get type => - $composableBuilder(column: $table.type, builder: (column) => column); - - i0.GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - i0.GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - i0.GeneratedColumn get width => - $composableBuilder(column: $table.width, builder: (column) => column); - - i0.GeneratedColumn get height => - $composableBuilder(column: $table.height, builder: (column) => column); - - i0.GeneratedColumn get durationMs => $composableBuilder( - column: $table.durationMs, - builder: (column) => column, - ); - - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get albumId => - $composableBuilder(column: $table.albumId, builder: (column) => column); - - i0.GeneratedColumn get checksum => - $composableBuilder(column: $table.checksum, builder: (column) => column); - - i0.GeneratedColumn get isFavorite => $composableBuilder( - column: $table.isFavorite, - builder: (column) => column, - ); - - i0.GeneratedColumn get orientation => $composableBuilder( - column: $table.orientation, - builder: (column) => column, - ); - - i0.GeneratedColumnWithTypeConverter get source => - $composableBuilder(column: $table.source, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter - get playbackStyle => $composableBuilder( - column: $table.playbackStyle, - builder: (column) => column, - ); -} - -class $$TrashedLocalAssetEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$TrashedLocalAssetEntityTable, - i1.TrashedLocalAssetEntityData, - i1.$$TrashedLocalAssetEntityTableFilterComposer, - i1.$$TrashedLocalAssetEntityTableOrderingComposer, - i1.$$TrashedLocalAssetEntityTableAnnotationComposer, - $$TrashedLocalAssetEntityTableCreateCompanionBuilder, - $$TrashedLocalAssetEntityTableUpdateCompanionBuilder, - ( - i1.TrashedLocalAssetEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$TrashedLocalAssetEntityTable, - i1.TrashedLocalAssetEntityData - >, - ), - i1.TrashedLocalAssetEntityData, - i0.PrefetchHooks Function() - > { - $$TrashedLocalAssetEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$TrashedLocalAssetEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$TrashedLocalAssetEntityTableFilterComposer( - $db: db, - $table: table, - ), - createOrderingComposer: () => - i1.$$TrashedLocalAssetEntityTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - i1.$$TrashedLocalAssetEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value name = const i0.Value.absent(), - i0.Value type = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - i0.Value id = const i0.Value.absent(), - i0.Value albumId = const i0.Value.absent(), - i0.Value checksum = const i0.Value.absent(), - i0.Value isFavorite = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - i0.Value source = const i0.Value.absent(), - i0.Value playbackStyle = - const i0.Value.absent(), - }) => i1.TrashedLocalAssetEntityCompanion( - name: name, - type: type, - createdAt: createdAt, - updatedAt: updatedAt, - width: width, - height: height, - durationMs: durationMs, - id: id, - albumId: albumId, - checksum: checksum, - isFavorite: isFavorite, - orientation: orientation, - source: source, - playbackStyle: playbackStyle, - ), - createCompanionCallback: - ({ - required String name, - required i2.AssetType type, - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - required String id, - required String albumId, - i0.Value checksum = const i0.Value.absent(), - i0.Value isFavorite = const i0.Value.absent(), - i0.Value orientation = const i0.Value.absent(), - required i3.TrashOrigin source, - i0.Value playbackStyle = - const i0.Value.absent(), - }) => i1.TrashedLocalAssetEntityCompanion.insert( - name: name, - type: type, - createdAt: createdAt, - updatedAt: updatedAt, - width: width, - height: height, - durationMs: durationMs, - id: id, - albumId: albumId, - checksum: checksum, - isFavorite: isFavorite, - orientation: orientation, - source: source, - playbackStyle: playbackStyle, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$TrashedLocalAssetEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$TrashedLocalAssetEntityTable, - i1.TrashedLocalAssetEntityData, - i1.$$TrashedLocalAssetEntityTableFilterComposer, - i1.$$TrashedLocalAssetEntityTableOrderingComposer, - i1.$$TrashedLocalAssetEntityTableAnnotationComposer, - $$TrashedLocalAssetEntityTableCreateCompanionBuilder, - $$TrashedLocalAssetEntityTableUpdateCompanionBuilder, - ( - i1.TrashedLocalAssetEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$TrashedLocalAssetEntityTable, - i1.TrashedLocalAssetEntityData - >, - ), - i1.TrashedLocalAssetEntityData, - i0.PrefetchHooks Function() - >; -i0.Index get idxTrashedLocalAssetChecksum => i0.Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', -); - -class $TrashedLocalAssetEntityTable extends i3.TrashedLocalAssetEntity - with - i0.TableInfo< - $TrashedLocalAssetEntityTable, - i1.TrashedLocalAssetEntityData - > { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $TrashedLocalAssetEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - late final i0.GeneratedColumnWithTypeConverter type = - i0.GeneratedColumn( - 'type', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$TrashedLocalAssetEntityTable.$convertertype, - ); - static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( - 'createdAt', - ); - @override - late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn( - 'created_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( - 'updatedAt', - ); - @override - late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - static const i0.VerificationMeta _widthMeta = const i0.VerificationMeta( - 'width', - ); - @override - late final i0.GeneratedColumn width = i0.GeneratedColumn( - 'width', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _heightMeta = const i0.VerificationMeta( - 'height', - ); - @override - late final i0.GeneratedColumn height = i0.GeneratedColumn( - 'height', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _durationMsMeta = const i0.VerificationMeta( - 'durationMs', - ); - @override - late final i0.GeneratedColumn durationMs = i0.GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta( - 'albumId', - ); - @override - late final i0.GeneratedColumn albumId = i0.GeneratedColumn( - 'album_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _checksumMeta = const i0.VerificationMeta( - 'checksum', - ); - @override - late final i0.GeneratedColumn checksum = i0.GeneratedColumn( - 'checksum', - aliasedName, - true, - type: i0.DriftSqlType.string, - requiredDuringInsert: false, - ); - static const i0.VerificationMeta _isFavoriteMeta = const i0.VerificationMeta( - 'isFavorite', - ); - @override - late final i0.GeneratedColumn isFavorite = i0.GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _orientationMeta = const i0.VerificationMeta( - 'orientation', - ); - @override - late final i0.GeneratedColumn orientation = i0.GeneratedColumn( - 'orientation', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ); - @override - late final i0.GeneratedColumnWithTypeConverter source = - i0.GeneratedColumn( - 'source', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$TrashedLocalAssetEntityTable.$convertersource, - ); - @override - late final i0.GeneratedColumnWithTypeConverter - playbackStyle = - i0.GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ).withConverter( - i1.$TrashedLocalAssetEntityTable.$converterplaybackStyle, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } - if (data.containsKey('width')) { - context.handle( - _widthMeta, - width.isAcceptableOrUnknown(data['width']!, _widthMeta), - ); - } - if (data.containsKey('height')) { - context.handle( - _heightMeta, - height.isAcceptableOrUnknown(data['height']!, _heightMeta), - ); - } - if (data.containsKey('duration_ms')) { - context.handle( - _durationMsMeta, - durationMs.isAcceptableOrUnknown(data['duration_ms']!, _durationMsMeta), - ); - } - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('album_id')) { - context.handle( - _albumIdMeta, - albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta), - ); - } else if (isInserting) { - context.missing(_albumIdMeta); - } - if (data.containsKey('checksum')) { - context.handle( - _checksumMeta, - checksum.isAcceptableOrUnknown(data['checksum']!, _checksumMeta), - ); - } - if (data.containsKey('is_favorite')) { - context.handle( - _isFavoriteMeta, - isFavorite.isAcceptableOrUnknown(data['is_favorite']!, _isFavoriteMeta), - ); - } - if (data.containsKey('orientation')) { - context.handle( - _orientationMeta, - orientation.isAcceptableOrUnknown( - data['orientation']!, - _orientationMeta, - ), - ); - } - return context; - } - - @override - Set get $primaryKey => {id, albumId}; - @override - i1.TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: i1.$TrashedLocalAssetEntityTable.$convertertype.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - ), - createdAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: i1.$TrashedLocalAssetEntityTable.$convertersource.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ), - playbackStyle: i1.$TrashedLocalAssetEntityTable.$converterplaybackStyle - .fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ), - ); - } - - @override - $TrashedLocalAssetEntityTable createAlias(String alias) { - return $TrashedLocalAssetEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $convertertype = - const i0.EnumIndexConverter(i2.AssetType.values); - static i0.JsonTypeConverter2 $convertersource = - const i0.EnumIndexConverter(i3.TrashOrigin.values); - static i0.JsonTypeConverter2 - $converterplaybackStyle = const i0.EnumIndexConverter( - i2.AssetPlaybackStyle.values, - ); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends i0.DataClass - implements i0.Insertable { - final String name; - final i2.AssetType type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final i3.TrashOrigin source; - final i2.AssetPlaybackStyle playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = i0.Variable(name); - { - map['type'] = i0.Variable( - i1.$TrashedLocalAssetEntityTable.$convertertype.toSql(type), - ); - } - map['created_at'] = i0.Variable(createdAt); - map['updated_at'] = i0.Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = i0.Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = i0.Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = i0.Variable(durationMs); - } - map['id'] = i0.Variable(id); - map['album_id'] = i0.Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = i0.Variable(checksum); - } - map['is_favorite'] = i0.Variable(isFavorite); - map['orientation'] = i0.Variable(orientation); - { - map['source'] = i0.Variable( - i1.$TrashedLocalAssetEntityTable.$convertersource.toSql(source), - ); - } - { - map['playback_style'] = i0.Variable( - i1.$TrashedLocalAssetEntityTable.$converterplaybackStyle.toSql( - playbackStyle, - ), - ); - } - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: i1.$TrashedLocalAssetEntityTable.$convertertype.fromJson( - serializer.fromJson(json['type']), - ), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: i1.$TrashedLocalAssetEntityTable.$convertersource.fromJson( - serializer.fromJson(json['source']), - ), - playbackStyle: i1.$TrashedLocalAssetEntityTable.$converterplaybackStyle - .fromJson(serializer.fromJson(json['playbackStyle'])), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson( - i1.$TrashedLocalAssetEntityTable.$convertertype.toJson(type), - ), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson( - i1.$TrashedLocalAssetEntityTable.$convertersource.toJson(source), - ), - 'playbackStyle': serializer.toJson( - i1.$TrashedLocalAssetEntityTable.$converterplaybackStyle.toJson( - playbackStyle, - ), - ), - }; - } - - i1.TrashedLocalAssetEntityData copyWith({ - String? name, - i2.AssetType? type, - DateTime? createdAt, - DateTime? updatedAt, - i0.Value width = const i0.Value.absent(), - i0.Value height = const i0.Value.absent(), - i0.Value durationMs = const i0.Value.absent(), - String? id, - String? albumId, - i0.Value checksum = const i0.Value.absent(), - bool? isFavorite, - int? orientation, - i3.TrashOrigin? source, - i2.AssetPlaybackStyle? playbackStyle, - }) => i1.TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - i1.TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends i0.UpdateCompanion { - final i0.Value name; - final i0.Value type; - final i0.Value createdAt; - final i0.Value updatedAt; - final i0.Value width; - final i0.Value height; - final i0.Value durationMs; - final i0.Value id; - final i0.Value albumId; - final i0.Value checksum; - final i0.Value isFavorite; - final i0.Value orientation; - final i0.Value source; - final i0.Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const i0.Value.absent(), - this.type = const i0.Value.absent(), - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.durationMs = const i0.Value.absent(), - this.id = const i0.Value.absent(), - this.albumId = const i0.Value.absent(), - this.checksum = const i0.Value.absent(), - this.isFavorite = const i0.Value.absent(), - this.orientation = const i0.Value.absent(), - this.source = const i0.Value.absent(), - this.playbackStyle = const i0.Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required i2.AssetType type, - this.createdAt = const i0.Value.absent(), - this.updatedAt = const i0.Value.absent(), - this.width = const i0.Value.absent(), - this.height = const i0.Value.absent(), - this.durationMs = const i0.Value.absent(), - required String id, - required String albumId, - this.checksum = const i0.Value.absent(), - this.isFavorite = const i0.Value.absent(), - this.orientation = const i0.Value.absent(), - required i3.TrashOrigin source, - this.playbackStyle = const i0.Value.absent(), - }) : name = i0.Value(name), - type = i0.Value(type), - id = i0.Value(id), - albumId = i0.Value(albumId), - source = i0.Value(source); - static i0.Insertable custom({ - i0.Expression? name, - i0.Expression? type, - i0.Expression? createdAt, - i0.Expression? updatedAt, - i0.Expression? width, - i0.Expression? height, - i0.Expression? durationMs, - i0.Expression? id, - i0.Expression? albumId, - i0.Expression? checksum, - i0.Expression? isFavorite, - i0.Expression? orientation, - i0.Expression? source, - i0.Expression? playbackStyle, - }) { - return i0.RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - i1.TrashedLocalAssetEntityCompanion copyWith({ - i0.Value? name, - i0.Value? type, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? width, - i0.Value? height, - i0.Value? durationMs, - i0.Value? id, - i0.Value? albumId, - i0.Value? checksum, - i0.Value? isFavorite, - i0.Value? orientation, - i0.Value? source, - i0.Value? playbackStyle, - }) { - return i1.TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (type.present) { - map['type'] = i0.Variable( - i1.$TrashedLocalAssetEntityTable.$convertertype.toSql(type.value), - ); - } - if (createdAt.present) { - map['created_at'] = i0.Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = i0.Variable(updatedAt.value); - } - if (width.present) { - map['width'] = i0.Variable(width.value); - } - if (height.present) { - map['height'] = i0.Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = i0.Variable(durationMs.value); - } - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (albumId.present) { - map['album_id'] = i0.Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = i0.Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = i0.Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = i0.Variable(orientation.value); - } - if (source.present) { - map['source'] = i0.Variable( - i1.$TrashedLocalAssetEntityTable.$convertersource.toSql(source.value), - ); - } - if (playbackStyle.present) { - map['playback_style'] = i0.Variable( - i1.$TrashedLocalAssetEntityTable.$converterplaybackStyle.toSql( - playbackStyle.value, - ), - ); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -i0.Index get idxTrashedLocalAssetAlbum => i0.Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', -); diff --git a/mobile/lib/infrastructure/entities/user.entity.drift.dart b/mobile/lib/infrastructure/entities/user.entity.drift.dart deleted file mode 100644 index 083c14a095..0000000000 --- a/mobile/lib/infrastructure/entities/user.entity.drift.dart +++ /dev/null @@ -1,655 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/user.model.dart' as i2; -import 'package:immich_mobile/infrastructure/entities/user.entity.dart' as i3; -import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4; - -typedef $$UserEntityTableCreateCompanionBuilder = - i1.UserEntityCompanion Function({ - required String id, - required String name, - required String email, - i0.Value hasProfileImage, - i0.Value profileChangedAt, - i0.Value avatarColor, - }); -typedef $$UserEntityTableUpdateCompanionBuilder = - i1.UserEntityCompanion Function({ - i0.Value id, - i0.Value name, - i0.Value email, - i0.Value hasProfileImage, - i0.Value profileChangedAt, - i0.Value avatarColor, - }); - -class $$UserEntityTableFilterComposer - extends i0.Composer { - $$UserEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get email => $composableBuilder( - column: $table.email, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get hasProfileImage => $composableBuilder( - column: $table.hasProfileImage, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnFilters get profileChangedAt => $composableBuilder( - column: $table.profileChangedAt, - builder: (column) => i0.ColumnFilters(column), - ); - - i0.ColumnWithTypeConverterFilters - get avatarColor => $composableBuilder( - column: $table.avatarColor, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); -} - -class $$UserEntityTableOrderingComposer - extends i0.Composer { - $$UserEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get email => $composableBuilder( - column: $table.email, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get hasProfileImage => $composableBuilder( - column: $table.hasProfileImage, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get profileChangedAt => $composableBuilder( - column: $table.profileChangedAt, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get avatarColor => $composableBuilder( - column: $table.avatarColor, - builder: (column) => i0.ColumnOrderings(column), - ); -} - -class $$UserEntityTableAnnotationComposer - extends i0.Composer { - $$UserEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - i0.GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - i0.GeneratedColumn get email => - $composableBuilder(column: $table.email, builder: (column) => column); - - i0.GeneratedColumn get hasProfileImage => $composableBuilder( - column: $table.hasProfileImage, - builder: (column) => column, - ); - - i0.GeneratedColumn get profileChangedAt => $composableBuilder( - column: $table.profileChangedAt, - builder: (column) => column, - ); - - i0.GeneratedColumnWithTypeConverter get avatarColor => - $composableBuilder( - column: $table.avatarColor, - builder: (column) => column, - ); -} - -class $$UserEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$UserEntityTable, - i1.UserEntityData, - i1.$$UserEntityTableFilterComposer, - i1.$$UserEntityTableOrderingComposer, - i1.$$UserEntityTableAnnotationComposer, - $$UserEntityTableCreateCompanionBuilder, - $$UserEntityTableUpdateCompanionBuilder, - ( - i1.UserEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$UserEntityTable, - i1.UserEntityData - >, - ), - i1.UserEntityData, - i0.PrefetchHooks Function() - > { - $$UserEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$UserEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - i1.$$UserEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$UserEntityTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - i1.$$UserEntityTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - i0.Value id = const i0.Value.absent(), - i0.Value name = const i0.Value.absent(), - i0.Value email = const i0.Value.absent(), - i0.Value hasProfileImage = const i0.Value.absent(), - i0.Value profileChangedAt = const i0.Value.absent(), - i0.Value avatarColor = const i0.Value.absent(), - }) => i1.UserEntityCompanion( - id: id, - name: name, - email: email, - hasProfileImage: hasProfileImage, - profileChangedAt: profileChangedAt, - avatarColor: avatarColor, - ), - createCompanionCallback: - ({ - required String id, - required String name, - required String email, - i0.Value hasProfileImage = const i0.Value.absent(), - i0.Value profileChangedAt = const i0.Value.absent(), - i0.Value avatarColor = const i0.Value.absent(), - }) => i1.UserEntityCompanion.insert( - id: id, - name: name, - email: email, - hasProfileImage: hasProfileImage, - profileChangedAt: profileChangedAt, - avatarColor: avatarColor, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$UserEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$UserEntityTable, - i1.UserEntityData, - i1.$$UserEntityTableFilterComposer, - i1.$$UserEntityTableOrderingComposer, - i1.$$UserEntityTableAnnotationComposer, - $$UserEntityTableCreateCompanionBuilder, - $$UserEntityTableUpdateCompanionBuilder, - ( - i1.UserEntityData, - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$UserEntityTable, - i1.UserEntityData - >, - ), - i1.UserEntityData, - i0.PrefetchHooks Function() - >; - -class $UserEntityTable extends i3.UserEntity - with i0.TableInfo<$UserEntityTable, i1.UserEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $UserEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); - @override - late final i0.GeneratedColumn id = i0.GeneratedColumn( - 'id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta( - 'name', - ); - @override - late final i0.GeneratedColumn name = i0.GeneratedColumn( - 'name', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _emailMeta = const i0.VerificationMeta( - 'email', - ); - @override - late final i0.GeneratedColumn email = i0.GeneratedColumn( - 'email', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - ); - static const i0.VerificationMeta _hasProfileImageMeta = - const i0.VerificationMeta('hasProfileImage'); - @override - late final i0.GeneratedColumn hasProfileImage = - i0.GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const i4.Constant(false), - ); - static const i0.VerificationMeta _profileChangedAtMeta = - const i0.VerificationMeta('profileChangedAt'); - @override - late final i0.GeneratedColumn profileChangedAt = - i0.GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: i0.DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: i4.currentDateAndTime, - ); - @override - late final i0.GeneratedColumnWithTypeConverter - avatarColor = i0.GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const i4.Constant(0), - ).withConverter(i1.$UserEntityTable.$converteravatarColor); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.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('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('email')) { - context.handle( - _emailMeta, - email.isAcceptableOrUnknown(data['email']!, _emailMeta), - ); - } else if (isInserting) { - context.missing(_emailMeta); - } - if (data.containsKey('has_profile_image')) { - context.handle( - _hasProfileImageMeta, - hasProfileImage.isAcceptableOrUnknown( - data['has_profile_image']!, - _hasProfileImageMeta, - ), - ); - } - if (data.containsKey('profile_changed_at')) { - context.handle( - _profileChangedAtMeta, - profileChangedAt.isAcceptableOrUnknown( - data['profile_changed_at']!, - _profileChangedAtMeta, - ), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - i1.UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.UserEntityData( - id: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - i0.DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - i0.DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: i1.$UserEntityTable.$converteravatarColor.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ), - ); - } - - @override - $UserEntityTable createAlias(String alias) { - return $UserEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converteravatarColor = - const i0.EnumIndexConverter(i2.AvatarColor.values); - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends i0.DataClass - implements i0.Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final i2.AvatarColor avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = i0.Variable(id); - map['name'] = i0.Variable(name); - map['email'] = i0.Variable(email); - map['has_profile_image'] = i0.Variable(hasProfileImage); - map['profile_changed_at'] = i0.Variable(profileChangedAt); - { - map['avatar_color'] = i0.Variable( - i1.$UserEntityTable.$converteravatarColor.toSql(avatarColor), - ); - } - return map; - } - - factory UserEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: i1.$UserEntityTable.$converteravatarColor.fromJson( - serializer.fromJson(json['avatarColor']), - ), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson( - i1.$UserEntityTable.$converteravatarColor.toJson(avatarColor), - ), - }; - } - - i1.UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - i2.AvatarColor? avatarColor, - }) => i1.UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(i1.UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends i0.UpdateCompanion { - final i0.Value id; - final i0.Value name; - final i0.Value email; - final i0.Value hasProfileImage; - final i0.Value profileChangedAt; - final i0.Value avatarColor; - const UserEntityCompanion({ - this.id = const i0.Value.absent(), - this.name = const i0.Value.absent(), - this.email = const i0.Value.absent(), - this.hasProfileImage = const i0.Value.absent(), - this.profileChangedAt = const i0.Value.absent(), - this.avatarColor = const i0.Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const i0.Value.absent(), - this.profileChangedAt = const i0.Value.absent(), - this.avatarColor = const i0.Value.absent(), - }) : id = i0.Value(id), - name = i0.Value(name), - email = i0.Value(email); - static i0.Insertable custom({ - i0.Expression? id, - i0.Expression? name, - i0.Expression? email, - i0.Expression? hasProfileImage, - i0.Expression? profileChangedAt, - i0.Expression? avatarColor, - }) { - return i0.RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - i1.UserEntityCompanion copyWith({ - i0.Value? id, - i0.Value? name, - i0.Value? email, - i0.Value? hasProfileImage, - i0.Value? profileChangedAt, - i0.Value? avatarColor, - }) { - return i1.UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = i0.Variable(id.value); - } - if (name.present) { - map['name'] = i0.Variable(name.value); - } - if (email.present) { - map['email'] = i0.Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = i0.Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = i0.Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = i0.Variable( - i1.$UserEntityTable.$converteravatarColor.toSql(avatarColor.value), - ); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/entities/user_metadata.entity.drift.dart b/mobile/lib/infrastructure/entities/user_metadata.entity.drift.dart deleted file mode 100644 index 6ea08d09d2..0000000000 --- a/mobile/lib/infrastructure/entities/user_metadata.entity.drift.dart +++ /dev/null @@ -1,613 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.drift.dart' - as i1; -import 'package:immich_mobile/domain/models/user_metadata.model.dart' as i2; -import 'dart:typed_data' as i3; -import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.dart' - as i4; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i5; -import 'package:drift/internal/modular.dart' as i6; - -typedef $$UserMetadataEntityTableCreateCompanionBuilder = - i1.UserMetadataEntityCompanion Function({ - required String userId, - required i2.UserMetadataKey key, - required Map value, - }); -typedef $$UserMetadataEntityTableUpdateCompanionBuilder = - i1.UserMetadataEntityCompanion Function({ - i0.Value userId, - i0.Value key, - i0.Value> value, - }); - -final class $$UserMetadataEntityTableReferences - extends - i0.BaseReferences< - i0.GeneratedDatabase, - i1.$UserMetadataEntityTable, - i1.UserMetadataEntityData - > { - $$UserMetadataEntityTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static i5.$UserEntityTable _userIdTable(i0.GeneratedDatabase db) => - i6.ReadDatabaseContainer(db) - .resultSet('user_entity') - .createAlias('user_metadata_entity__user_id__user_entity__id'); - - i5.$$UserEntityTableProcessedTableManager get userId { - final $_column = $_itemColumn('user_id')!; - - final manager = i5 - .$$UserEntityTableTableManager( - $_db, - i6.ReadDatabaseContainer( - $_db, - ).resultSet('user_entity'), - ) - .filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_userIdTable($_db)); - if (item == null) return manager; - return i0.ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$UserMetadataEntityTableFilterComposer - extends i0.Composer { - $$UserMetadataEntityTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnWithTypeConverterFilters - get key => $composableBuilder( - column: $table.key, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i0.ColumnWithTypeConverterFilters< - Map, - Map, - i3.Uint8List - > - get value => $composableBuilder( - column: $table.value, - builder: (column) => i0.ColumnWithTypeConverterFilters(column), - ); - - i5.$$UserEntityTableFilterComposer get userId { - final i5.$$UserEntityTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.userId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableFilterComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$UserMetadataEntityTableOrderingComposer - extends i0.Composer { - $$UserMetadataEntityTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.ColumnOrderings get key => $composableBuilder( - column: $table.key, - builder: (column) => i0.ColumnOrderings(column), - ); - - i0.ColumnOrderings get value => $composableBuilder( - column: $table.value, - builder: (column) => i0.ColumnOrderings(column), - ); - - i5.$$UserEntityTableOrderingComposer get userId { - final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.userId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableOrderingComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$UserMetadataEntityTableAnnotationComposer - extends i0.Composer { - $$UserMetadataEntityTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - i0.GeneratedColumnWithTypeConverter get key => - $composableBuilder(column: $table.key, builder: (column) => column); - - i0.GeneratedColumnWithTypeConverter, i3.Uint8List> - get value => - $composableBuilder(column: $table.value, builder: (column) => column); - - i5.$$UserEntityTableAnnotationComposer get userId { - final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.userId, - referencedTable: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => i5.$$UserEntityTableAnnotationComposer( - $db: $db, - $table: i6.ReadDatabaseContainer( - $db, - ).resultSet('user_entity'), - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$UserMetadataEntityTableTableManager - extends - i0.RootTableManager< - i0.GeneratedDatabase, - i1.$UserMetadataEntityTable, - i1.UserMetadataEntityData, - i1.$$UserMetadataEntityTableFilterComposer, - i1.$$UserMetadataEntityTableOrderingComposer, - i1.$$UserMetadataEntityTableAnnotationComposer, - $$UserMetadataEntityTableCreateCompanionBuilder, - $$UserMetadataEntityTableUpdateCompanionBuilder, - (i1.UserMetadataEntityData, i1.$$UserMetadataEntityTableReferences), - i1.UserMetadataEntityData, - i0.PrefetchHooks Function({bool userId}) - > { - $$UserMetadataEntityTableTableManager( - i0.GeneratedDatabase db, - i1.$UserMetadataEntityTable table, - ) : super( - i0.TableManagerState( - db: db, - table: table, - createFilteringComposer: () => i1 - .$$UserMetadataEntityTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - i1.$$UserMetadataEntityTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - i1.$$UserMetadataEntityTableAnnotationComposer( - $db: db, - $table: table, - ), - updateCompanionCallback: - ({ - i0.Value userId = const i0.Value.absent(), - i0.Value key = const i0.Value.absent(), - i0.Value> value = const i0.Value.absent(), - }) => i1.UserMetadataEntityCompanion( - userId: userId, - key: key, - value: value, - ), - createCompanionCallback: - ({ - required String userId, - required i2.UserMetadataKey key, - required Map value, - }) => i1.UserMetadataEntityCompanion.insert( - userId: userId, - key: key, - value: value, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - i1.$$UserMetadataEntityTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({userId = false}) { - return i0.PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends i0.TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (userId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.userId, - referencedTable: i1 - .$$UserMetadataEntityTableReferences - ._userIdTable(db), - referencedColumn: i1 - .$$UserMetadataEntityTableReferences - ._userIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$UserMetadataEntityTableProcessedTableManager = - i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$UserMetadataEntityTable, - i1.UserMetadataEntityData, - i1.$$UserMetadataEntityTableFilterComposer, - i1.$$UserMetadataEntityTableOrderingComposer, - i1.$$UserMetadataEntityTableAnnotationComposer, - $$UserMetadataEntityTableCreateCompanionBuilder, - $$UserMetadataEntityTableUpdateCompanionBuilder, - (i1.UserMetadataEntityData, i1.$$UserMetadataEntityTableReferences), - i1.UserMetadataEntityData, - i0.PrefetchHooks Function({bool userId}) - >; - -class $UserMetadataEntityTable extends i4.UserMetadataEntity - with i0.TableInfo<$UserMetadataEntityTable, i1.UserMetadataEntityData> { - @override - final i0.GeneratedDatabase attachedDatabase; - final String? _alias; - $UserMetadataEntityTable(this.attachedDatabase, [this._alias]); - static const i0.VerificationMeta _userIdMeta = const i0.VerificationMeta( - 'userId', - ); - @override - late final i0.GeneratedColumn userId = i0.GeneratedColumn( - 'user_id', - aliasedName, - false, - type: i0.DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: i0.GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - @override - late final i0.GeneratedColumnWithTypeConverter key = - i0.GeneratedColumn( - 'key', - aliasedName, - false, - type: i0.DriftSqlType.int, - requiredDuringInsert: true, - ).withConverter( - i1.$UserMetadataEntityTable.$converterkey, - ); - @override - late final i0.GeneratedColumnWithTypeConverter< - Map, - i3.Uint8List - > - value = - i0.GeneratedColumn( - 'value', - aliasedName, - false, - type: i0.DriftSqlType.blob, - requiredDuringInsert: true, - ).withConverter>( - i1.$UserMetadataEntityTable.$convertervalue, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - i0.VerificationContext validateIntegrity( - i0.Insertable instance, { - bool isInserting = false, - }) { - final context = i0.VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('user_id')) { - context.handle( - _userIdMeta, - userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta), - ); - } else if (isInserting) { - context.missing(_userIdMeta); - } - return context; - } - - @override - Set get $primaryKey => {userId, key}; - @override - i1.UserMetadataEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return i1.UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - i0.DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: i1.$UserMetadataEntityTable.$converterkey.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - ), - value: i1.$UserMetadataEntityTable.$convertervalue.fromSql( - attachedDatabase.typeMapping.read( - i0.DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ), - ); - } - - @override - $UserMetadataEntityTable createAlias(String alias) { - return $UserMetadataEntityTable(attachedDatabase, alias); - } - - static i0.JsonTypeConverter2 $converterkey = - const i0.EnumIndexConverter( - i2.UserMetadataKey.values, - ); - static i0.JsonTypeConverter2, i3.Uint8List, Object?> - $convertervalue = i4.userMetadataConverter; - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends i0.DataClass - implements i0.Insertable { - final String userId; - final i2.UserMetadataKey key; - final Map value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = i0.Variable(userId); - { - map['key'] = i0.Variable( - i1.$UserMetadataEntityTable.$converterkey.toSql(key), - ); - } - { - map['value'] = i0.Variable( - i1.$UserMetadataEntityTable.$convertervalue.toSql(value), - ); - } - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - i0.ValueSerializer? serializer, - }) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: i1.$UserMetadataEntityTable.$converterkey.fromJson( - serializer.fromJson(json['key']), - ), - value: i1.$UserMetadataEntityTable.$convertervalue.fromJson( - serializer.fromJson(json['value']), - ), - ); - } - @override - Map toJson({i0.ValueSerializer? serializer}) { - serializer ??= i0.driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson( - i1.$UserMetadataEntityTable.$converterkey.toJson(key), - ), - 'value': serializer.toJson( - i1.$UserMetadataEntityTable.$convertervalue.toJson(value), - ), - }; - } - - i1.UserMetadataEntityData copyWith({ - String? userId, - i2.UserMetadataKey? key, - Map? value, - }) => i1.UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion( - i1.UserMetadataEntityCompanion data, - ) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, value); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is i1.UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - other.value == this.value); -} - -class UserMetadataEntityCompanion - extends i0.UpdateCompanion { - final i0.Value userId; - final i0.Value key; - final i0.Value> value; - const UserMetadataEntityCompanion({ - this.userId = const i0.Value.absent(), - this.key = const i0.Value.absent(), - this.value = const i0.Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required i2.UserMetadataKey key, - required Map value, - }) : userId = i0.Value(userId), - key = i0.Value(key), - value = i0.Value(value); - static i0.Insertable custom({ - i0.Expression? userId, - i0.Expression? key, - i0.Expression? value, - }) { - return i0.RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - i1.UserMetadataEntityCompanion copyWith({ - i0.Value? userId, - i0.Value? key, - i0.Value>? value, - }) { - return i1.UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = i0.Variable(userId.value); - } - if (key.present) { - map['key'] = i0.Variable( - i1.$UserMetadataEntityTable.$converterkey.toSql(key.value), - ); - } - if (value.present) { - map['value'] = i0.Variable( - i1.$UserMetadataEntityTable.$convertervalue.toSql(value.value), - ); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} diff --git a/mobile/lib/infrastructure/repositories/db.repository.drift.dart b/mobile/lib/infrastructure/repositories/db.repository.drift.dart deleted file mode 100644 index a5996716ed..0000000000 --- a/mobile/lib/infrastructure/repositories/db.repository.drift.dart +++ /dev/null @@ -1,418 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart' - as i1; -import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart' - as i2; -import 'package:immich_mobile/infrastructure/entities/stack.entity.drift.dart' - as i3; -import 'package:immich_mobile/infrastructure/entities/local_asset.entity.drift.dart' - as i4; -import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart' - as i5; -import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.dart' - as i6; -import 'package:immich_mobile/infrastructure/entities/local_album_asset.entity.drift.dart' - as i7; -import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart' - as i8; -import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.drift.dart' - as i9; -import 'package:immich_mobile/infrastructure/entities/partner.entity.drift.dart' - as i10; -import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart' - as i11; -import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.drift.dart' - as i12; -import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart' - as i13; -import 'package:immich_mobile/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart' - as i14; -import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart' - as i15; -import 'package:immich_mobile/infrastructure/entities/memory_asset.entity.drift.dart' - as i16; -import 'package:immich_mobile/infrastructure/entities/person.entity.drift.dart' - as i17; -import 'package:immich_mobile/infrastructure/entities/asset_face.entity.drift.dart' - as i18; -import 'package:immich_mobile/infrastructure/entities/store.entity.drift.dart' - as i19; -import 'package:immich_mobile/infrastructure/entities/trashed_local_asset.entity.drift.dart' - as i20; -import 'package:immich_mobile/infrastructure/entities/asset_edit.entity.drift.dart' - as i21; -import 'package:immich_mobile/infrastructure/entities/settings.entity.drift.dart' - as i22; -import 'package:immich_mobile/infrastructure/entities/asset_ocr.entity.drift.dart' - as i23; -import 'package:immich_mobile/infrastructure/entities/merged_asset.drift.dart' - as i24; -import 'package:drift/internal/modular.dart' as i25; - -abstract class $Drift extends i0.GeneratedDatabase { - $Drift(i0.QueryExecutor e) : super(e); - $DriftManager get managers => $DriftManager(this); - late final i1.$UserEntityTable userEntity = i1.$UserEntityTable(this); - late final i2.$RemoteAssetEntityTable remoteAssetEntity = i2 - .$RemoteAssetEntityTable(this); - late final i3.$StackEntityTable stackEntity = i3.$StackEntityTable(this); - late final i4.$LocalAssetEntityTable localAssetEntity = i4 - .$LocalAssetEntityTable(this); - late final i5.$RemoteAlbumEntityTable remoteAlbumEntity = i5 - .$RemoteAlbumEntityTable(this); - late final i6.$LocalAlbumEntityTable localAlbumEntity = i6 - .$LocalAlbumEntityTable(this); - late final i7.$LocalAlbumAssetEntityTable localAlbumAssetEntity = i7 - .$LocalAlbumAssetEntityTable(this); - late final i8.$AuthUserEntityTable authUserEntity = i8.$AuthUserEntityTable( - this, - ); - late final i9.$UserMetadataEntityTable userMetadataEntity = i9 - .$UserMetadataEntityTable(this); - late final i10.$PartnerEntityTable partnerEntity = i10.$PartnerEntityTable( - this, - ); - late final i11.$RemoteExifEntityTable remoteExifEntity = i11 - .$RemoteExifEntityTable(this); - late final i12.$RemoteAlbumAssetEntityTable remoteAlbumAssetEntity = i12 - .$RemoteAlbumAssetEntityTable(this); - late final i13.$RemoteAlbumUserEntityTable remoteAlbumUserEntity = i13 - .$RemoteAlbumUserEntityTable(this); - late final i14.$RemoteAssetCloudIdEntityTable remoteAssetCloudIdEntity = i14 - .$RemoteAssetCloudIdEntityTable(this); - late final i15.$MemoryEntityTable memoryEntity = i15.$MemoryEntityTable(this); - late final i16.$MemoryAssetEntityTable memoryAssetEntity = i16 - .$MemoryAssetEntityTable(this); - late final i17.$PersonEntityTable personEntity = i17.$PersonEntityTable(this); - late final i18.$AssetFaceEntityTable assetFaceEntity = i18 - .$AssetFaceEntityTable(this); - late final i19.$StoreEntityTable storeEntity = i19.$StoreEntityTable(this); - late final i20.$TrashedLocalAssetEntityTable trashedLocalAssetEntity = i20 - .$TrashedLocalAssetEntityTable(this); - late final i21.$AssetEditEntityTable assetEditEntity = i21 - .$AssetEditEntityTable(this); - late final i22.$SettingsEntityTable settingsEntity = i22.$SettingsEntityTable( - this, - ); - late final i23.$AssetOcrEntityTable assetOcrEntity = i23.$AssetOcrEntityTable( - this, - ); - i24.MergedAssetDrift get mergedAssetDrift => i25.ReadDatabaseContainer( - this, - ).accessor(i24.MergedAssetDrift.new); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - i7.idxLocalAlbumAssetAlbumAsset, - i4.idxLocalAssetChecksum, - i4.idxLocalAssetCloudId, - i4.idxLocalAssetCreatedAt, - i3.idxStackPrimaryAssetId, - i2.uQRemoteAssetsOwnerChecksum, - i2.uQRemoteAssetsOwnerLibraryChecksum, - i2.idxRemoteAssetChecksum, - i2.idxRemoteAssetStackId, - i2.idxRemoteAssetOwnerVisibilityDeletedCreated, - i2.idxRemoteAssetUploaded, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - settingsEntity, - assetOcrEntity, - i10.idxPartnerSharedWithId, - i11.idxLatLng, - i11.idxRemoteExifCity, - i12.idxRemoteAlbumAssetAlbumAsset, - i14.idxRemoteAssetCloudId, - i17.idxPersonOwnerId, - i18.idxAssetFacePersonId, - i18.idxAssetFaceAssetId, - i18.idxAssetFaceVisiblePerson, - i20.idxTrashedLocalAssetChecksum, - i20.idxTrashedLocalAssetAlbum, - i21.idxAssetEditAssetId, - i23.idxAssetOcrAssetId, - ]; - @override - i0.StreamQueryUpdateRules - get streamUpdateRules => const i0.StreamQueryUpdateRules([ - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('stack_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_album_entity', kind: i0.UpdateKind.update), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('local_album_entity', kind: i0.UpdateKind.update), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('local_album_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('local_album_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('user_metadata_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('partner_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('partner_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_exif_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_album_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_album_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_album_user_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('remote_album_user_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate( - 'remote_asset_cloud_id_entity', - kind: i0.UpdateKind.delete, - ), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('memory_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('memory_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [ - i0.TableUpdate('memory_asset_entity', kind: i0.UpdateKind.delete), - ], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('person_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('asset_face_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('asset_face_entity', kind: i0.UpdateKind.update)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('asset_edit_entity', kind: i0.UpdateKind.delete)], - ), - i0.WritePropagation( - on: i0.TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: i0.UpdateKind.delete, - ), - result: [i0.TableUpdate('asset_ocr_entity', kind: i0.UpdateKind.delete)], - ), - ]); - @override - i0.DriftDatabaseOptions get options => - const i0.DriftDatabaseOptions(storeDateTimeAsText: true); -} - -class $DriftManager { - final $Drift _db; - $DriftManager(this._db); - i1.$$UserEntityTableTableManager get userEntity => - i1.$$UserEntityTableTableManager(_db, _db.userEntity); - i2.$$RemoteAssetEntityTableTableManager get remoteAssetEntity => - i2.$$RemoteAssetEntityTableTableManager(_db, _db.remoteAssetEntity); - i3.$$StackEntityTableTableManager get stackEntity => - i3.$$StackEntityTableTableManager(_db, _db.stackEntity); - i4.$$LocalAssetEntityTableTableManager get localAssetEntity => - i4.$$LocalAssetEntityTableTableManager(_db, _db.localAssetEntity); - i5.$$RemoteAlbumEntityTableTableManager get remoteAlbumEntity => - i5.$$RemoteAlbumEntityTableTableManager(_db, _db.remoteAlbumEntity); - i6.$$LocalAlbumEntityTableTableManager get localAlbumEntity => - i6.$$LocalAlbumEntityTableTableManager(_db, _db.localAlbumEntity); - i7.$$LocalAlbumAssetEntityTableTableManager get localAlbumAssetEntity => i7 - .$$LocalAlbumAssetEntityTableTableManager(_db, _db.localAlbumAssetEntity); - i8.$$AuthUserEntityTableTableManager get authUserEntity => - i8.$$AuthUserEntityTableTableManager(_db, _db.authUserEntity); - i9.$$UserMetadataEntityTableTableManager get userMetadataEntity => - i9.$$UserMetadataEntityTableTableManager(_db, _db.userMetadataEntity); - i10.$$PartnerEntityTableTableManager get partnerEntity => - i10.$$PartnerEntityTableTableManager(_db, _db.partnerEntity); - i11.$$RemoteExifEntityTableTableManager get remoteExifEntity => - i11.$$RemoteExifEntityTableTableManager(_db, _db.remoteExifEntity); - i12.$$RemoteAlbumAssetEntityTableTableManager get remoteAlbumAssetEntity => - i12.$$RemoteAlbumAssetEntityTableTableManager( - _db, - _db.remoteAlbumAssetEntity, - ); - i13.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i13 - .$$RemoteAlbumUserEntityTableTableManager(_db, _db.remoteAlbumUserEntity); - i14.$$RemoteAssetCloudIdEntityTableTableManager - get remoteAssetCloudIdEntity => - i14.$$RemoteAssetCloudIdEntityTableTableManager( - _db, - _db.remoteAssetCloudIdEntity, - ); - i15.$$MemoryEntityTableTableManager get memoryEntity => - i15.$$MemoryEntityTableTableManager(_db, _db.memoryEntity); - i16.$$MemoryAssetEntityTableTableManager get memoryAssetEntity => - i16.$$MemoryAssetEntityTableTableManager(_db, _db.memoryAssetEntity); - i17.$$PersonEntityTableTableManager get personEntity => - i17.$$PersonEntityTableTableManager(_db, _db.personEntity); - i18.$$AssetFaceEntityTableTableManager get assetFaceEntity => - i18.$$AssetFaceEntityTableTableManager(_db, _db.assetFaceEntity); - i19.$$StoreEntityTableTableManager get storeEntity => - i19.$$StoreEntityTableTableManager(_db, _db.storeEntity); - i20.$$TrashedLocalAssetEntityTableTableManager get trashedLocalAssetEntity => - i20.$$TrashedLocalAssetEntityTableTableManager( - _db, - _db.trashedLocalAssetEntity, - ); - i21.$$AssetEditEntityTableTableManager get assetEditEntity => - i21.$$AssetEditEntityTableTableManager(_db, _db.assetEditEntity); - i22.$$SettingsEntityTableTableManager get settingsEntity => - i22.$$SettingsEntityTableTableManager(_db, _db.settingsEntity); - i23.$$AssetOcrEntityTableTableManager get assetOcrEntity => - i23.$$AssetOcrEntityTableTableManager(_db, _db.assetOcrEntity); -} diff --git a/mobile/lib/infrastructure/repositories/logger_db.repository.drift.dart b/mobile/lib/infrastructure/repositories/logger_db.repository.drift.dart deleted file mode 100644 index 8389d3a827..0000000000 --- a/mobile/lib/infrastructure/repositories/logger_db.repository.drift.dart +++ /dev/null @@ -1,27 +0,0 @@ -// dart format width=80 -// ignore_for_file: type=lint -import 'package:drift/drift.dart' as i0; -import 'package:immich_mobile/infrastructure/entities/log.entity.drift.dart' - as i1; - -abstract class $DriftLogger extends i0.GeneratedDatabase { - $DriftLogger(i0.QueryExecutor e) : super(e); - $DriftLoggerManager get managers => $DriftLoggerManager(this); - late final i1.$LogMessageEntityTable logMessageEntity = i1 - .$LogMessageEntityTable(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [logMessageEntity]; - @override - i0.DriftDatabaseOptions get options => - const i0.DriftDatabaseOptions(storeDateTimeAsText: true); -} - -class $DriftLoggerManager { - final $DriftLogger _db; - $DriftLoggerManager(this._db); - i1.$$LogMessageEntityTableTableManager get logMessageEntity => - i1.$$LogMessageEntityTableTableManager(_db, _db.logMessageEntity); -} diff --git a/mobile/mise.toml b/mobile/mise.toml index 869a52a048..ce7c626e18 100644 --- a/mobile/mise.toml +++ b/mobile/mise.toml @@ -14,8 +14,12 @@ macos-x64 = { asset_pattern = "dcm-macos-x64-release.zip" } macos-arm64 = { asset_pattern = "dcm-macos-arm-release.zip" } windows-x64 = { asset_pattern = "dcm-windows-release.zip" } -[tasks."codegen:dart"] +[tasks.codegen] alias = "codegen" +description = "Generate all codegen artifacts" +depends = ["codegen:dart", "codegen:drift:schema", "codegen:pigeon", "codegen:translation"] + +[tasks."codegen:dart"] description = "Execute build_runner to auto-generate dart code" sources = [ "pubspec.yaml", @@ -29,6 +33,12 @@ run = [ "dart format lib/routing/router.gr.dart", ] +[tasks."codegen:drift:schema"] +description = "Generate Drift migration schema test code" +sources = ["drift_schemas/main/*.json"] +outputs = { auto = true } +run = "dart run drift_dev schema generate --data-classes --companions drift_schemas/main/ test/drift/main/generated/" + [tasks."codegen:watch"] alias = "watch" description = "Watch and auto-generate dart code" diff --git a/mobile/test/drift/main/generated/schema.dart b/mobile/test/drift/main/generated/schema.dart deleted file mode 100644 index ee5900c1d1..0000000000 --- a/mobile/test/drift/main/generated/schema.dart +++ /dev/null @@ -1,143 +0,0 @@ -// dart format width=80 -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; -import 'package:drift/internal/migrations.dart'; -import 'schema_v1.dart' as v1; -import 'schema_v2.dart' as v2; -import 'schema_v3.dart' as v3; -import 'schema_v4.dart' as v4; -import 'schema_v5.dart' as v5; -import 'schema_v6.dart' as v6; -import 'schema_v7.dart' as v7; -import 'schema_v8.dart' as v8; -import 'schema_v9.dart' as v9; -import 'schema_v10.dart' as v10; -import 'schema_v11.dart' as v11; -import 'schema_v12.dart' as v12; -import 'schema_v13.dart' as v13; -import 'schema_v14.dart' as v14; -import 'schema_v15.dart' as v15; -import 'schema_v16.dart' as v16; -import 'schema_v17.dart' as v17; -import 'schema_v18.dart' as v18; -import 'schema_v19.dart' as v19; -import 'schema_v20.dart' as v20; -import 'schema_v21.dart' as v21; -import 'schema_v22.dart' as v22; -import 'schema_v23.dart' as v23; -import 'schema_v24.dart' as v24; -import 'schema_v25.dart' as v25; -import 'schema_v26.dart' as v26; -import 'schema_v27.dart' as v27; -import 'schema_v28.dart' as v28; -import 'schema_v29.dart' as v29; -import 'schema_v30.dart' as v30; -import 'schema_v31.dart' as v31; - -class GeneratedHelper implements SchemaInstantiationHelper { - @override - GeneratedDatabase databaseForVersion(QueryExecutor db, int version) { - switch (version) { - case 1: - return v1.DatabaseAtV1(db); - case 2: - return v2.DatabaseAtV2(db); - case 3: - return v3.DatabaseAtV3(db); - case 4: - return v4.DatabaseAtV4(db); - case 5: - return v5.DatabaseAtV5(db); - case 6: - return v6.DatabaseAtV6(db); - case 7: - return v7.DatabaseAtV7(db); - case 8: - return v8.DatabaseAtV8(db); - case 9: - return v9.DatabaseAtV9(db); - case 10: - return v10.DatabaseAtV10(db); - case 11: - return v11.DatabaseAtV11(db); - case 12: - return v12.DatabaseAtV12(db); - case 13: - return v13.DatabaseAtV13(db); - case 14: - return v14.DatabaseAtV14(db); - case 15: - return v15.DatabaseAtV15(db); - case 16: - return v16.DatabaseAtV16(db); - case 17: - return v17.DatabaseAtV17(db); - case 18: - return v18.DatabaseAtV18(db); - case 19: - return v19.DatabaseAtV19(db); - case 20: - return v20.DatabaseAtV20(db); - case 21: - return v21.DatabaseAtV21(db); - case 22: - return v22.DatabaseAtV22(db); - case 23: - return v23.DatabaseAtV23(db); - case 24: - return v24.DatabaseAtV24(db); - case 25: - return v25.DatabaseAtV25(db); - case 26: - return v26.DatabaseAtV26(db); - case 27: - return v27.DatabaseAtV27(db); - case 28: - return v28.DatabaseAtV28(db); - case 29: - return v29.DatabaseAtV29(db); - case 30: - return v30.DatabaseAtV30(db); - case 31: - return v31.DatabaseAtV31(db); - default: - throw MissingSchemaException(version, versions); - } - } - - static const versions = const [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - ]; -} diff --git a/mobile/test/drift/main/generated/schema_v1.dart b/mobile/test/drift/main/generated/schema_v1.dart deleted file mode 100644 index 3755a2bd5c..0000000000 --- a/mobile/test/drift/main/generated/schema_v1.dart +++ /dev/null @@ -1,5998 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn profileImagePath = GeneratedColumn( - 'profile_image_path', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - profileImagePath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_image_path'], - ), - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - ), - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final String? profileImagePath; - final DateTime updatedAt; - final int? quotaSizeInBytes; - final int quotaUsageInBytes; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - this.profileImagePath, - required this.updatedAt, - this.quotaSizeInBytes, - required this.quotaUsageInBytes, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - if (!nullToAbsent || profileImagePath != null) { - map['profile_image_path'] = Variable(profileImagePath); - } - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || quotaSizeInBytes != null) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - } - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - profileImagePath: serializer.fromJson(json['profileImagePath']), - updatedAt: serializer.fromJson(json['updatedAt']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'profileImagePath': serializer.toJson(profileImagePath), - 'updatedAt': serializer.toJson(updatedAt), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - Value profileImagePath = const Value.absent(), - DateTime? updatedAt, - Value quotaSizeInBytes = const Value.absent(), - int? quotaUsageInBytes, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath.present - ? profileImagePath.value - : this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes.present - ? quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - profileImagePath: data.profileImagePath.present - ? data.profileImagePath.value - : this.profileImagePath, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.profileImagePath == this.profileImagePath && - other.updatedAt == this.updatedAt && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value profileImagePath; - final Value updatedAt; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? profileImagePath, - Expression? updatedAt, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (profileImagePath != null) 'profile_image_path': profileImagePath, - if (updatedAt != null) 'updated_at': updatedAt, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? profileImagePath, - Value? updatedAt, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath ?? this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (profileImagePath.present) { - map['profile_image_path'] = Variable(profileImagePath.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id)', - ), - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbnailPath = GeneratedColumn( - 'thumbnail_path', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - thumbnailPath, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - thumbnailPath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_path'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final String thumbnailPath; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.thumbnailPath, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['thumbnail_path'] = Variable(thumbnailPath); - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - thumbnailPath: serializer.fromJson(json['thumbnailPath']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'thumbnailPath': serializer.toJson(thumbnailPath), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - String? thumbnailPath, - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - thumbnailPath: thumbnailPath ?? this.thumbnailPath, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - thumbnailPath: data.thumbnailPath.present - ? data.thumbnailPath.value - : this.thumbnailPath, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('thumbnailPath: $thumbnailPath, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - thumbnailPath, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.thumbnailPath == this.thumbnailPath && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value thumbnailPath; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.thumbnailPath = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required String thumbnailPath, - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - thumbnailPath = Value(thumbnailPath), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? thumbnailPath, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (thumbnailPath != null) 'thumbnail_path': thumbnailPath, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? thumbnailPath, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - thumbnailPath: thumbnailPath ?? this.thumbnailPath, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (thumbnailPath.present) { - map['thumbnail_path'] = Variable(thumbnailPath.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('thumbnailPath: $thumbnailPath, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV1 extends GeneratedDatabase { - DatabaseAtV1(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index uQRemoteAssetOwnerChecksum = Index( - 'UQ_remote_asset_owner_checksum', - 'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - localAssetEntity, - stackEntity, - idxLocalAssetChecksum, - uQRemoteAssetOwnerChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - localAlbumEntity, - localAlbumAssetEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - ]; - @override - int get schemaVersion => 1; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v10.dart b/mobile/test/drift/main/generated/schema_v10.dart deleted file mode 100644 index c8d97eea37..0000000000 --- a/mobile/test/drift/main/generated/schema_v10.dart +++ /dev/null @@ -1,7162 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV10 extends GeneratedDatabase { - DatabaseAtV10(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - idxLatLng, - ]; - @override - int get schemaVersion => 10; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v11.dart b/mobile/test/drift/main/generated/schema_v11.dart deleted file mode 100644 index ce6508b2f7..0000000000 --- a/mobile/test/drift/main/generated/schema_v11.dart +++ /dev/null @@ -1,7201 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV11 extends GeneratedDatabase { - DatabaseAtV11(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - idxLatLng, - ]; - @override - int get schemaVersion => 11; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v12.dart b/mobile/test/drift/main/generated/schema_v12.dart deleted file mode 100644 index 75ca519048..0000000000 --- a/mobile/test/drift/main/generated/schema_v12.dart +++ /dev/null @@ -1,7201 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV12 extends GeneratedDatabase { - DatabaseAtV12(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - idxLatLng, - ]; - @override - int get schemaVersion => 12; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v13.dart b/mobile/test/drift/main/generated/schema_v13.dart deleted file mode 100644 index 2afc279f74..0000000000 --- a/mobile/test/drift/main/generated/schema_v13.dart +++ /dev/null @@ -1,7768 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV13 extends GeneratedDatabase { - DatabaseAtV13(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxLatLng, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 13; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v14.dart b/mobile/test/drift/main/generated/schema_v14.dart deleted file mode 100644 index 69aac3360f..0000000000 --- a/mobile/test/drift/main/generated/schema_v14.dart +++ /dev/null @@ -1,7881 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV14 extends GeneratedDatabase { - DatabaseAtV14(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxLatLng, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 14; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v15.dart b/mobile/test/drift/main/generated/schema_v15.dart deleted file mode 100644 index 01ac59162b..0000000000 --- a/mobile/test/drift/main/generated/schema_v15.dart +++ /dev/null @@ -1,7916 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV15 extends GeneratedDatabase { - DatabaseAtV15(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxLatLng, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 15; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v16.dart b/mobile/test/drift/main/generated/schema_v16.dart deleted file mode 100644 index be336a8dac..0000000000 --- a/mobile/test/drift/main/generated/schema_v16.dart +++ /dev/null @@ -1,8302 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV16 extends GeneratedDatabase { - DatabaseAtV16(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxLatLng, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 16; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v17.dart b/mobile/test/drift/main/generated/schema_v17.dart deleted file mode 100644 index 2314eeac7c..0000000000 --- a/mobile/test/drift/main/generated/schema_v17.dart +++ /dev/null @@ -1,8340 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - bool? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV17 extends GeneratedDatabase { - DatabaseAtV17(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxLatLng, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 17; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v18.dart b/mobile/test/drift/main/generated/schema_v18.dart deleted file mode 100644 index 9265566c47..0000000000 --- a/mobile/test/drift/main/generated/schema_v18.dart +++ /dev/null @@ -1,8345 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - bool? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV18 extends GeneratedDatabase { - DatabaseAtV18(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxLatLng, - idxRemoteAssetCloudId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 18; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v19.dart b/mobile/test/drift/main/generated/schema_v19.dart deleted file mode 100644 index 1e80670893..0000000000 --- a/mobile/test/drift/main/generated/schema_v19.dart +++ /dev/null @@ -1,8400 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - bool? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV19 extends GeneratedDatabase { - DatabaseAtV19(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAlbumOwnerId = Index( - 'idx_remote_album_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_owner_id ON remote_album_entity (owner_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetLocalDateTimeDay = Index( - 'idx_remote_asset_local_date_time_day', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_day ON remote_asset_entity (STRFTIME(\'%Y-%m-%d\', local_date_time))', - ); - late final Index idxRemoteAssetLocalDateTimeMonth = Index( - 'idx_remote_asset_local_date_time_month', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_month ON remote_asset_entity (STRFTIME(\'%Y-%m\', local_date_time))', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxRemoteAlbumOwnerId, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetLocalDateTimeDay, - idxRemoteAssetLocalDateTimeMonth, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 19; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v2.dart b/mobile/test/drift/main/generated/schema_v2.dart deleted file mode 100644 index 18fcc75002..0000000000 --- a/mobile/test/drift/main/generated/schema_v2.dart +++ /dev/null @@ -1,5998 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn profileImagePath = GeneratedColumn( - 'profile_image_path', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - profileImagePath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_image_path'], - ), - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - ), - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final String? profileImagePath; - final DateTime updatedAt; - final int? quotaSizeInBytes; - final int quotaUsageInBytes; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - this.profileImagePath, - required this.updatedAt, - this.quotaSizeInBytes, - required this.quotaUsageInBytes, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - if (!nullToAbsent || profileImagePath != null) { - map['profile_image_path'] = Variable(profileImagePath); - } - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || quotaSizeInBytes != null) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - } - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - profileImagePath: serializer.fromJson(json['profileImagePath']), - updatedAt: serializer.fromJson(json['updatedAt']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'profileImagePath': serializer.toJson(profileImagePath), - 'updatedAt': serializer.toJson(updatedAt), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - Value profileImagePath = const Value.absent(), - DateTime? updatedAt, - Value quotaSizeInBytes = const Value.absent(), - int? quotaUsageInBytes, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath.present - ? profileImagePath.value - : this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes.present - ? quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - profileImagePath: data.profileImagePath.present - ? data.profileImagePath.value - : this.profileImagePath, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.profileImagePath == this.profileImagePath && - other.updatedAt == this.updatedAt && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value profileImagePath; - final Value updatedAt; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? profileImagePath, - Expression? updatedAt, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (profileImagePath != null) 'profile_image_path': profileImagePath, - if (updatedAt != null) 'updated_at': updatedAt, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? profileImagePath, - Value? updatedAt, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath ?? this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (profileImagePath.present) { - map['profile_image_path'] = Variable(profileImagePath.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id)', - ), - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbnailPath = GeneratedColumn( - 'thumbnail_path', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - thumbnailPath, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - thumbnailPath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_path'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final String thumbnailPath; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.thumbnailPath, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['thumbnail_path'] = Variable(thumbnailPath); - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - thumbnailPath: serializer.fromJson(json['thumbnailPath']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'thumbnailPath': serializer.toJson(thumbnailPath), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - String? thumbnailPath, - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - thumbnailPath: thumbnailPath ?? this.thumbnailPath, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - thumbnailPath: data.thumbnailPath.present - ? data.thumbnailPath.value - : this.thumbnailPath, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('thumbnailPath: $thumbnailPath, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - thumbnailPath, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.thumbnailPath == this.thumbnailPath && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value thumbnailPath; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.thumbnailPath = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required String thumbnailPath, - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - thumbnailPath = Value(thumbnailPath), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? thumbnailPath, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (thumbnailPath != null) 'thumbnail_path': thumbnailPath, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? thumbnailPath, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - thumbnailPath: thumbnailPath ?? this.thumbnailPath, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (thumbnailPath.present) { - map['thumbnail_path'] = Variable(thumbnailPath.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('thumbnailPath: $thumbnailPath, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV2 extends GeneratedDatabase { - DatabaseAtV2(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index uQRemoteAssetOwnerChecksum = Index( - 'UQ_remote_asset_owner_checksum', - 'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - localAssetEntity, - stackEntity, - idxLocalAssetChecksum, - uQRemoteAssetOwnerChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - localAlbumEntity, - localAlbumAssetEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - ]; - @override - int get schemaVersion => 2; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v20.dart b/mobile/test/drift/main/generated/schema_v20.dart deleted file mode 100644 index 0cb8a46cac..0000000000 --- a/mobile/test/drift/main/generated/schema_v20.dart +++ /dev/null @@ -1,8474 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - bool? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_visible" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final bool isVisible; - final DateTime? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - bool? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV20 extends GeneratedDatabase { - DatabaseAtV20(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAlbumOwnerId = Index( - 'idx_remote_album_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_owner_id ON remote_album_entity (owner_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetLocalDateTimeDay = Index( - 'idx_remote_asset_local_date_time_day', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_day ON remote_asset_entity (STRFTIME(\'%Y-%m-%d\', local_date_time))', - ); - late final Index idxRemoteAssetLocalDateTimeMonth = Index( - 'idx_remote_asset_local_date_time_month', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_month ON remote_asset_entity (STRFTIME(\'%Y-%m\', local_date_time))', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxRemoteAlbumOwnerId, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetLocalDateTimeDay, - idxRemoteAssetLocalDateTimeMonth, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 20; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v21.dart b/mobile/test/drift/main/generated/schema_v21.dart deleted file mode 100644 index 5777b5f850..0000000000 --- a/mobile/test/drift/main/generated/schema_v21.dart +++ /dev/null @@ -1,8548 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - bool? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_visible" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final bool isVisible; - final DateTime? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - bool? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV21 extends GeneratedDatabase { - DatabaseAtV21(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAlbumOwnerId = Index( - 'idx_remote_album_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_owner_id ON remote_album_entity (owner_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetLocalDateTimeDay = Index( - 'idx_remote_asset_local_date_time_day', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_day ON remote_asset_entity (STRFTIME(\'%Y-%m-%d\', local_date_time))', - ); - late final Index idxRemoteAssetLocalDateTimeMonth = Index( - 'idx_remote_asset_local_date_time_month', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_month ON remote_asset_entity (STRFTIME(\'%Y-%m\', local_date_time))', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxRemoteAlbumOwnerId, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetLocalDateTimeDay, - idxRemoteAssetLocalDateTimeMonth, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - ]; - @override - int get schemaVersion => 21; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v22.dart b/mobile/test/drift/main/generated/schema_v22.dart deleted file mode 100644 index c1abad0d24..0000000000 --- a/mobile/test/drift/main/generated/schema_v22.dart +++ /dev/null @@ -1,8849 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_edited" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final bool isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - bool? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - final String? iCloudId; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [assetId, albumId, marker_]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final bool? marker_; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker_ = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker_); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker_ == this.marker_); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker_; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker_ = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker_, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final bool isAdmin; - final bool hasProfileImage; - final DateTime profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - bool? isAdmin, - bool? hasProfileImage, - DateTime? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn adjustmentTime = - GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final DateTime? createdAt; - final DateTime? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_visible" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final bool isVisible; - final DateTime? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - bool? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String albumId; - final String? checksum; - final bool isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV22 extends GeneratedDatabase { - DatabaseAtV22(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAlbumOwnerId = Index( - 'idx_remote_album_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_owner_id ON remote_album_entity (owner_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetLocalDateTimeDay = Index( - 'idx_remote_asset_local_date_time_day', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_day ON remote_asset_entity (STRFTIME(\'%Y-%m-%d\', local_date_time))', - ); - late final Index idxRemoteAssetLocalDateTimeMonth = Index( - 'idx_remote_asset_local_date_time_month', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_month ON remote_asset_entity (STRFTIME(\'%Y-%m\', local_date_time))', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxRemoteAlbumOwnerId, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetLocalDateTimeDay, - idxRemoteAssetLocalDateTimeMonth, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - int get schemaVersion => 22; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v23.dart b/mobile/test/drift/main/generated/schema_v23.dart deleted file mode 100644 index 35402af876..0000000000 --- a/mobile/test/drift/main/generated/schema_v23.dart +++ /dev/null @@ -1,9179 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV23 extends GeneratedDatabase { - DatabaseAtV23(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAlbumOwnerId = Index( - 'idx_remote_album_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_owner_id ON remote_album_entity (owner_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetLocalDateTimeDay = Index( - 'idx_remote_asset_local_date_time_day', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_day ON remote_asset_entity (STRFTIME(\'%Y-%m-%d\', local_date_time))', - ); - late final Index idxRemoteAssetLocalDateTimeMonth = Index( - 'idx_remote_asset_local_date_time_month', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_month ON remote_asset_entity (STRFTIME(\'%Y-%m\', local_date_time))', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxRemoteAlbumOwnerId, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetLocalDateTimeDay, - idxRemoteAssetLocalDateTimeMonth, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 23; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v24.dart b/mobile/test/drift/main/generated/schema_v24.dart deleted file mode 100644 index 872731c31f..0000000000 --- a/mobile/test/drift/main/generated/schema_v24.dart +++ /dev/null @@ -1,9131 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV24 extends GeneratedDatabase { - DatabaseAtV24(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetLocalDateTimeDay = Index( - 'idx_remote_asset_local_date_time_day', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_day ON remote_asset_entity (STRFTIME(\'%Y-%m-%d\', local_date_time))', - ); - late final Index idxRemoteAssetLocalDateTimeMonth = Index( - 'idx_remote_asset_local_date_time_month', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_local_date_time_month ON remote_asset_entity (STRFTIME(\'%Y-%m\', local_date_time))', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetLocalDateTimeDay, - idxRemoteAssetLocalDateTimeMonth, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 24; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v25.dart b/mobile/test/drift/main/generated/schema_v25.dart deleted file mode 100644 index aad45f0bd3..0000000000 --- a/mobile/test/drift/main/generated/schema_v25.dart +++ /dev/null @@ -1,9345 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Metadata extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Metadata(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'metadata'; - @override - Set get $primaryKey => {key}; - @override - MetadataData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MetadataData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Metadata createAlias(String alias) { - return Metadata(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class MetadataData extends DataClass implements Insertable { - final String key; - final String value; - final String updatedAt; - const MetadataData({ - required this.key, - required this.value, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - map['value'] = Variable(value); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory MetadataData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MetadataData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - MetadataData copyWith({String? key, String? value, String? updatedAt}) => - MetadataData( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - MetadataData copyWithCompanion(MetadataCompanion data) { - return MetadataData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('MetadataData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MetadataData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class MetadataCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const MetadataCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - MetadataCompanion.insert({ - required String key, - required String value, - this.updatedAt = const Value.absent(), - }) : key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - MetadataCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return MetadataCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MetadataCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV25 extends GeneratedDatabase { - DatabaseAtV25(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Metadata metadata = Metadata(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - metadata, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 25; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v26.dart b/mobile/test/drift/main/generated/schema_v26.dart deleted file mode 100644 index b91afd1b8a..0000000000 --- a/mobile/test/drift/main/generated/schema_v26.dart +++ /dev/null @@ -1,9384 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn uploadedAt = GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? uploadedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value uploadedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value uploadedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? uploadedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? uploadedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Metadata extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Metadata(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'metadata'; - @override - Set get $primaryKey => {key}; - @override - MetadataData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MetadataData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Metadata createAlias(String alias) { - return Metadata(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class MetadataData extends DataClass implements Insertable { - final String key; - final String value; - final String updatedAt; - const MetadataData({ - required this.key, - required this.value, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - map['value'] = Variable(value); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory MetadataData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MetadataData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - MetadataData copyWith({String? key, String? value, String? updatedAt}) => - MetadataData( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - MetadataData copyWithCompanion(MetadataCompanion data) { - return MetadataData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('MetadataData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MetadataData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class MetadataCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const MetadataCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - MetadataCompanion.insert({ - required String key, - required String value, - this.updatedAt = const Value.absent(), - }) : key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - MetadataCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return MetadataCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MetadataCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV26 extends GeneratedDatabase { - DatabaseAtV26(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Metadata metadata = Metadata(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - metadata, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 26; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v27.dart b/mobile/test/drift/main/generated/schema_v27.dart deleted file mode 100644 index 2b02946175..0000000000 --- a/mobile/test/drift/main/generated/schema_v27.dart +++ /dev/null @@ -1,9384 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn uploadedAt = GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? uploadedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value uploadedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value uploadedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? uploadedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? uploadedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Settings extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Settings(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'settings'; - @override - Set get $primaryKey => {key}; - @override - SettingsData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return SettingsData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Settings createAlias(String alias) { - return Settings(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class SettingsData extends DataClass implements Insertable { - final String key; - final String value; - final String updatedAt; - const SettingsData({ - required this.key, - required this.value, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - map['value'] = Variable(value); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory SettingsData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return SettingsData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - SettingsData copyWith({String? key, String? value, String? updatedAt}) => - SettingsData( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - SettingsData copyWithCompanion(SettingsCompanion data) { - return SettingsData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('SettingsData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is SettingsData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class SettingsCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const SettingsCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - SettingsCompanion.insert({ - required String key, - required String value, - this.updatedAt = const Value.absent(), - }) : key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - SettingsCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return SettingsCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingsCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV27 extends GeneratedDatabase { - DatabaseAtV27(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Settings settings = Settings(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - settings, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 27; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v28.dart b/mobile/test/drift/main/generated/schema_v28.dart deleted file mode 100644 index a18199ed4f..0000000000 --- a/mobile/test/drift/main/generated/schema_v28.dart +++ /dev/null @@ -1,9389 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn uploadedAt = GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? uploadedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value uploadedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value uploadedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? uploadedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? uploadedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Settings extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Settings(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'settings'; - @override - Set get $primaryKey => {key}; - @override - SettingsData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return SettingsData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Settings createAlias(String alias) { - return Settings(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class SettingsData extends DataClass implements Insertable { - final String key; - final String value; - final String updatedAt; - const SettingsData({ - required this.key, - required this.value, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - map['value'] = Variable(value); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory SettingsData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return SettingsData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - SettingsData copyWith({String? key, String? value, String? updatedAt}) => - SettingsData( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - SettingsData copyWithCompanion(SettingsCompanion data) { - return SettingsData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('SettingsData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is SettingsData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class SettingsCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const SettingsCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - SettingsCompanion.insert({ - required String key, - required String value, - this.updatedAt = const Value.absent(), - }) : key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - SettingsCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return SettingsCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingsCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV28 extends GeneratedDatabase { - DatabaseAtV28(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxLocalAssetCreatedAt = Index( - 'idx_local_asset_created_at', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_created_at ON local_asset_entity (created_at)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Settings settings = Settings(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxLocalAssetCreatedAt, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - settings, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 28; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v29.dart b/mobile/test/drift/main/generated/schema_v29.dart deleted file mode 100644 index ed721e3fe8..0000000000 --- a/mobile/test/drift/main/generated/schema_v29.dart +++ /dev/null @@ -1,10027 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn uploadedAt = GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? uploadedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value uploadedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value uploadedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? uploadedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? uploadedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Settings extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Settings(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'settings'; - @override - Set get $primaryKey => {key}; - @override - SettingsData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return SettingsData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Settings createAlias(String alias) { - return Settings(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class SettingsData extends DataClass implements Insertable { - final String key; - final String value; - final String updatedAt; - const SettingsData({ - required this.key, - required this.value, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - map['value'] = Variable(value); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory SettingsData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return SettingsData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - SettingsData copyWith({String? key, String? value, String? updatedAt}) => - SettingsData( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - SettingsData copyWithCompanion(SettingsCompanion data) { - return SettingsData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('SettingsData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is SettingsData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class SettingsCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const SettingsCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - SettingsCompanion.insert({ - required String key, - required String value, - this.updatedAt = const Value.absent(), - }) : key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - SettingsCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return SettingsCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingsCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class AssetOcrEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetOcrEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn x1 = GeneratedColumn( - 'x1', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y1 = GeneratedColumn( - 'y1', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x2 = GeneratedColumn( - 'x2', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y2 = GeneratedColumn( - 'y2', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x3 = GeneratedColumn( - 'x3', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y3 = GeneratedColumn( - 'y3', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x4 = GeneratedColumn( - 'x4', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y4 = GeneratedColumn( - 'y4', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boxScore = GeneratedColumn( - 'box_score', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn textScore = GeneratedColumn( - 'text_score', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn recognizedText = GeneratedColumn( - 'recognized_text', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - @override - List get $columns => [ - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_ocr_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetOcrEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetOcrEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - x1: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x1'], - )!, - y1: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y1'], - )!, - x2: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x2'], - )!, - y2: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y2'], - )!, - x3: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x3'], - )!, - y3: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y3'], - )!, - x4: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x4'], - )!, - y4: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y4'], - )!, - boxScore: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}box_score'], - )!, - textScore: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}text_score'], - )!, - recognizedText: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}recognized_text'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - ); - } - - @override - AssetOcrEntity createAlias(String alias) { - return AssetOcrEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetOcrEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final double x1; - final double y1; - final double x2; - final double y2; - final double x3; - final double y3; - final double x4; - final double y4; - final double boxScore; - final double textScore; - final String recognizedText; - final int isVisible; - const AssetOcrEntityData({ - required this.id, - required this.assetId, - required this.x1, - required this.y1, - required this.x2, - required this.y2, - required this.x3, - required this.y3, - required this.x4, - required this.y4, - required this.boxScore, - required this.textScore, - required this.recognizedText, - required this.isVisible, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['x1'] = Variable(x1); - map['y1'] = Variable(y1); - map['x2'] = Variable(x2); - map['y2'] = Variable(y2); - map['x3'] = Variable(x3); - map['y3'] = Variable(y3); - map['x4'] = Variable(x4); - map['y4'] = Variable(y4); - map['box_score'] = Variable(boxScore); - map['text_score'] = Variable(textScore); - map['recognized_text'] = Variable(recognizedText); - map['is_visible'] = Variable(isVisible); - return map; - } - - factory AssetOcrEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetOcrEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - x1: serializer.fromJson(json['x1']), - y1: serializer.fromJson(json['y1']), - x2: serializer.fromJson(json['x2']), - y2: serializer.fromJson(json['y2']), - x3: serializer.fromJson(json['x3']), - y3: serializer.fromJson(json['y3']), - x4: serializer.fromJson(json['x4']), - y4: serializer.fromJson(json['y4']), - boxScore: serializer.fromJson(json['boxScore']), - textScore: serializer.fromJson(json['textScore']), - recognizedText: serializer.fromJson(json['recognizedText']), - isVisible: serializer.fromJson(json['isVisible']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'x1': serializer.toJson(x1), - 'y1': serializer.toJson(y1), - 'x2': serializer.toJson(x2), - 'y2': serializer.toJson(y2), - 'x3': serializer.toJson(x3), - 'y3': serializer.toJson(y3), - 'x4': serializer.toJson(x4), - 'y4': serializer.toJson(y4), - 'boxScore': serializer.toJson(boxScore), - 'textScore': serializer.toJson(textScore), - 'recognizedText': serializer.toJson(recognizedText), - 'isVisible': serializer.toJson(isVisible), - }; - } - - AssetOcrEntityData copyWith({ - String? id, - String? assetId, - double? x1, - double? y1, - double? x2, - double? y2, - double? x3, - double? y3, - double? x4, - double? y4, - double? boxScore, - double? textScore, - String? recognizedText, - int? isVisible, - }) => AssetOcrEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - AssetOcrEntityData copyWithCompanion(AssetOcrEntityCompanion data) { - return AssetOcrEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - x1: data.x1.present ? data.x1.value : this.x1, - y1: data.y1.present ? data.y1.value : this.y1, - x2: data.x2.present ? data.x2.value : this.x2, - y2: data.y2.present ? data.y2.value : this.y2, - x3: data.x3.present ? data.x3.value : this.x3, - y3: data.y3.present ? data.y3.value : this.y3, - x4: data.x4.present ? data.x4.value : this.x4, - y4: data.y4.present ? data.y4.value : this.y4, - boxScore: data.boxScore.present ? data.boxScore.value : this.boxScore, - textScore: data.textScore.present ? data.textScore.value : this.textScore, - recognizedText: data.recognizedText.present - ? data.recognizedText.value - : this.recognizedText, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - ); - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetOcrEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.x1 == this.x1 && - other.y1 == this.y1 && - other.x2 == this.x2 && - other.y2 == this.y2 && - other.x3 == this.x3 && - other.y3 == this.y3 && - other.x4 == this.x4 && - other.y4 == this.y4 && - other.boxScore == this.boxScore && - other.textScore == this.textScore && - other.recognizedText == this.recognizedText && - other.isVisible == this.isVisible); -} - -class AssetOcrEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value x1; - final Value y1; - final Value x2; - final Value y2; - final Value x3; - final Value y3; - final Value x4; - final Value y4; - final Value boxScore; - final Value textScore; - final Value recognizedText; - final Value isVisible; - const AssetOcrEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.x1 = const Value.absent(), - this.y1 = const Value.absent(), - this.x2 = const Value.absent(), - this.y2 = const Value.absent(), - this.x3 = const Value.absent(), - this.y3 = const Value.absent(), - this.x4 = const Value.absent(), - this.y4 = const Value.absent(), - this.boxScore = const Value.absent(), - this.textScore = const Value.absent(), - this.recognizedText = const Value.absent(), - this.isVisible = const Value.absent(), - }); - AssetOcrEntityCompanion.insert({ - required String id, - required String assetId, - required double x1, - required double y1, - required double x2, - required double y2, - required double x3, - required double y3, - required double x4, - required double y4, - required double boxScore, - required double textScore, - required String recognizedText, - this.isVisible = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - x1 = Value(x1), - y1 = Value(y1), - x2 = Value(x2), - y2 = Value(y2), - x3 = Value(x3), - y3 = Value(y3), - x4 = Value(x4), - y4 = Value(y4), - boxScore = Value(boxScore), - textScore = Value(textScore), - recognizedText = Value(recognizedText); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? x1, - Expression? y1, - Expression? x2, - Expression? y2, - Expression? x3, - Expression? y3, - Expression? x4, - Expression? y4, - Expression? boxScore, - Expression? textScore, - Expression? recognizedText, - Expression? isVisible, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (x1 != null) 'x1': x1, - if (y1 != null) 'y1': y1, - if (x2 != null) 'x2': x2, - if (y2 != null) 'y2': y2, - if (x3 != null) 'x3': x3, - if (y3 != null) 'y3': y3, - if (x4 != null) 'x4': x4, - if (y4 != null) 'y4': y4, - if (boxScore != null) 'box_score': boxScore, - if (textScore != null) 'text_score': textScore, - if (recognizedText != null) 'recognized_text': recognizedText, - if (isVisible != null) 'is_visible': isVisible, - }); - } - - AssetOcrEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? x1, - Value? y1, - Value? x2, - Value? y2, - Value? x3, - Value? y3, - Value? x4, - Value? y4, - Value? boxScore, - Value? textScore, - Value? recognizedText, - Value? isVisible, - }) { - return AssetOcrEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (x1.present) { - map['x1'] = Variable(x1.value); - } - if (y1.present) { - map['y1'] = Variable(y1.value); - } - if (x2.present) { - map['x2'] = Variable(x2.value); - } - if (y2.present) { - map['y2'] = Variable(y2.value); - } - if (x3.present) { - map['x3'] = Variable(x3.value); - } - if (y3.present) { - map['y3'] = Variable(y3.value); - } - if (x4.present) { - map['x4'] = Variable(x4.value); - } - if (y4.present) { - map['y4'] = Variable(y4.value); - } - if (boxScore.present) { - map['box_score'] = Variable(boxScore.value); - } - if (textScore.present) { - map['text_score'] = Variable(textScore.value); - } - if (recognizedText.present) { - map['recognized_text'] = Variable(recognizedText.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV29 extends GeneratedDatabase { - DatabaseAtV29(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxLocalAssetCreatedAt = Index( - 'idx_local_asset_created_at', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_created_at ON local_asset_entity (created_at)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Settings settings = Settings(this); - late final AssetOcrEntity assetOcrEntity = AssetOcrEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - late final Index idxAssetOcrAssetId = Index( - 'idx_asset_ocr_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_ocr_asset_id ON asset_ocr_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxLocalAssetCreatedAt, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - settings, - assetOcrEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - idxAssetOcrAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_ocr_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 29; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v3.dart b/mobile/test/drift/main/generated/schema_v3.dart deleted file mode 100644 index ecfe09dfd7..0000000000 --- a/mobile/test/drift/main/generated/schema_v3.dart +++ /dev/null @@ -1,5995 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn profileImagePath = GeneratedColumn( - 'profile_image_path', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - profileImagePath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_image_path'], - ), - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - ), - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final String? profileImagePath; - final DateTime updatedAt; - final int? quotaSizeInBytes; - final int quotaUsageInBytes; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - this.profileImagePath, - required this.updatedAt, - this.quotaSizeInBytes, - required this.quotaUsageInBytes, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - if (!nullToAbsent || profileImagePath != null) { - map['profile_image_path'] = Variable(profileImagePath); - } - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || quotaSizeInBytes != null) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - } - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - profileImagePath: serializer.fromJson(json['profileImagePath']), - updatedAt: serializer.fromJson(json['updatedAt']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'profileImagePath': serializer.toJson(profileImagePath), - 'updatedAt': serializer.toJson(updatedAt), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - Value profileImagePath = const Value.absent(), - DateTime? updatedAt, - Value quotaSizeInBytes = const Value.absent(), - int? quotaUsageInBytes, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath.present - ? profileImagePath.value - : this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes.present - ? quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - profileImagePath: data.profileImagePath.present - ? data.profileImagePath.value - : this.profileImagePath, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.profileImagePath == this.profileImagePath && - other.updatedAt == this.updatedAt && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value profileImagePath; - final Value updatedAt; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? profileImagePath, - Expression? updatedAt, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (profileImagePath != null) 'profile_image_path': profileImagePath, - if (updatedAt != null) 'updated_at': updatedAt, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? profileImagePath, - Value? updatedAt, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath ?? this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (profileImagePath.present) { - map['profile_image_path'] = Variable(profileImagePath.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbnailPath = GeneratedColumn( - 'thumbnail_path', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - thumbnailPath, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - thumbnailPath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_path'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final String thumbnailPath; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.thumbnailPath, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['thumbnail_path'] = Variable(thumbnailPath); - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - thumbnailPath: serializer.fromJson(json['thumbnailPath']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'thumbnailPath': serializer.toJson(thumbnailPath), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - String? thumbnailPath, - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - thumbnailPath: thumbnailPath ?? this.thumbnailPath, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - thumbnailPath: data.thumbnailPath.present - ? data.thumbnailPath.value - : this.thumbnailPath, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('thumbnailPath: $thumbnailPath, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - thumbnailPath, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.thumbnailPath == this.thumbnailPath && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value thumbnailPath; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.thumbnailPath = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required String thumbnailPath, - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - thumbnailPath = Value(thumbnailPath), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? thumbnailPath, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (thumbnailPath != null) 'thumbnail_path': thumbnailPath, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? thumbnailPath, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - thumbnailPath: thumbnailPath ?? this.thumbnailPath, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (thumbnailPath.present) { - map['thumbnail_path'] = Variable(thumbnailPath.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('thumbnailPath: $thumbnailPath, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV3 extends GeneratedDatabase { - DatabaseAtV3(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index uQRemoteAssetOwnerChecksum = Index( - 'UQ_remote_asset_owner_checksum', - 'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - localAssetEntity, - stackEntity, - idxLocalAssetChecksum, - uQRemoteAssetOwnerChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - localAlbumEntity, - localAlbumAssetEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - ]; - @override - int get schemaVersion => 3; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v30.dart b/mobile/test/drift/main/generated/schema_v30.dart deleted file mode 100644 index 642bd4aadd..0000000000 --- a/mobile/test/drift/main/generated/schema_v30.dart +++ /dev/null @@ -1,10027 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn uploadedAt = GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? uploadedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value uploadedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value uploadedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? uploadedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? uploadedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Settings extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Settings(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'settings'; - @override - Set get $primaryKey => {key}; - @override - SettingsData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return SettingsData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - ), - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Settings createAlias(String alias) { - return Settings(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class SettingsData extends DataClass implements Insertable { - final String key; - final String? value; - final String updatedAt; - const SettingsData({required this.key, this.value, required this.updatedAt}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - if (!nullToAbsent || value != null) { - map['value'] = Variable(value); - } - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory SettingsData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return SettingsData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - SettingsData copyWith({ - String? key, - Value value = const Value.absent(), - String? updatedAt, - }) => SettingsData( - key: key ?? this.key, - value: value.present ? value.value : this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - SettingsData copyWithCompanion(SettingsCompanion data) { - return SettingsData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('SettingsData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is SettingsData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class SettingsCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const SettingsCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - SettingsCompanion.insert({ - required String key, - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : key = Value(key); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - SettingsCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return SettingsCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingsCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class AssetOcrEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetOcrEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn x1 = GeneratedColumn( - 'x1', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y1 = GeneratedColumn( - 'y1', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x2 = GeneratedColumn( - 'x2', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y2 = GeneratedColumn( - 'y2', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x3 = GeneratedColumn( - 'x3', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y3 = GeneratedColumn( - 'y3', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x4 = GeneratedColumn( - 'x4', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y4 = GeneratedColumn( - 'y4', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boxScore = GeneratedColumn( - 'box_score', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn textScore = GeneratedColumn( - 'text_score', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn recognizedText = GeneratedColumn( - 'recognized_text', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - @override - List get $columns => [ - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_ocr_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetOcrEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetOcrEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - x1: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x1'], - )!, - y1: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y1'], - )!, - x2: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x2'], - )!, - y2: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y2'], - )!, - x3: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x3'], - )!, - y3: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y3'], - )!, - x4: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x4'], - )!, - y4: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y4'], - )!, - boxScore: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}box_score'], - )!, - textScore: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}text_score'], - )!, - recognizedText: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}recognized_text'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - ); - } - - @override - AssetOcrEntity createAlias(String alias) { - return AssetOcrEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetOcrEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final double x1; - final double y1; - final double x2; - final double y2; - final double x3; - final double y3; - final double x4; - final double y4; - final double boxScore; - final double textScore; - final String recognizedText; - final int isVisible; - const AssetOcrEntityData({ - required this.id, - required this.assetId, - required this.x1, - required this.y1, - required this.x2, - required this.y2, - required this.x3, - required this.y3, - required this.x4, - required this.y4, - required this.boxScore, - required this.textScore, - required this.recognizedText, - required this.isVisible, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['x1'] = Variable(x1); - map['y1'] = Variable(y1); - map['x2'] = Variable(x2); - map['y2'] = Variable(y2); - map['x3'] = Variable(x3); - map['y3'] = Variable(y3); - map['x4'] = Variable(x4); - map['y4'] = Variable(y4); - map['box_score'] = Variable(boxScore); - map['text_score'] = Variable(textScore); - map['recognized_text'] = Variable(recognizedText); - map['is_visible'] = Variable(isVisible); - return map; - } - - factory AssetOcrEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetOcrEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - x1: serializer.fromJson(json['x1']), - y1: serializer.fromJson(json['y1']), - x2: serializer.fromJson(json['x2']), - y2: serializer.fromJson(json['y2']), - x3: serializer.fromJson(json['x3']), - y3: serializer.fromJson(json['y3']), - x4: serializer.fromJson(json['x4']), - y4: serializer.fromJson(json['y4']), - boxScore: serializer.fromJson(json['boxScore']), - textScore: serializer.fromJson(json['textScore']), - recognizedText: serializer.fromJson(json['recognizedText']), - isVisible: serializer.fromJson(json['isVisible']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'x1': serializer.toJson(x1), - 'y1': serializer.toJson(y1), - 'x2': serializer.toJson(x2), - 'y2': serializer.toJson(y2), - 'x3': serializer.toJson(x3), - 'y3': serializer.toJson(y3), - 'x4': serializer.toJson(x4), - 'y4': serializer.toJson(y4), - 'boxScore': serializer.toJson(boxScore), - 'textScore': serializer.toJson(textScore), - 'recognizedText': serializer.toJson(recognizedText), - 'isVisible': serializer.toJson(isVisible), - }; - } - - AssetOcrEntityData copyWith({ - String? id, - String? assetId, - double? x1, - double? y1, - double? x2, - double? y2, - double? x3, - double? y3, - double? x4, - double? y4, - double? boxScore, - double? textScore, - String? recognizedText, - int? isVisible, - }) => AssetOcrEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - AssetOcrEntityData copyWithCompanion(AssetOcrEntityCompanion data) { - return AssetOcrEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - x1: data.x1.present ? data.x1.value : this.x1, - y1: data.y1.present ? data.y1.value : this.y1, - x2: data.x2.present ? data.x2.value : this.x2, - y2: data.y2.present ? data.y2.value : this.y2, - x3: data.x3.present ? data.x3.value : this.x3, - y3: data.y3.present ? data.y3.value : this.y3, - x4: data.x4.present ? data.x4.value : this.x4, - y4: data.y4.present ? data.y4.value : this.y4, - boxScore: data.boxScore.present ? data.boxScore.value : this.boxScore, - textScore: data.textScore.present ? data.textScore.value : this.textScore, - recognizedText: data.recognizedText.present - ? data.recognizedText.value - : this.recognizedText, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - ); - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetOcrEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.x1 == this.x1 && - other.y1 == this.y1 && - other.x2 == this.x2 && - other.y2 == this.y2 && - other.x3 == this.x3 && - other.y3 == this.y3 && - other.x4 == this.x4 && - other.y4 == this.y4 && - other.boxScore == this.boxScore && - other.textScore == this.textScore && - other.recognizedText == this.recognizedText && - other.isVisible == this.isVisible); -} - -class AssetOcrEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value x1; - final Value y1; - final Value x2; - final Value y2; - final Value x3; - final Value y3; - final Value x4; - final Value y4; - final Value boxScore; - final Value textScore; - final Value recognizedText; - final Value isVisible; - const AssetOcrEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.x1 = const Value.absent(), - this.y1 = const Value.absent(), - this.x2 = const Value.absent(), - this.y2 = const Value.absent(), - this.x3 = const Value.absent(), - this.y3 = const Value.absent(), - this.x4 = const Value.absent(), - this.y4 = const Value.absent(), - this.boxScore = const Value.absent(), - this.textScore = const Value.absent(), - this.recognizedText = const Value.absent(), - this.isVisible = const Value.absent(), - }); - AssetOcrEntityCompanion.insert({ - required String id, - required String assetId, - required double x1, - required double y1, - required double x2, - required double y2, - required double x3, - required double y3, - required double x4, - required double y4, - required double boxScore, - required double textScore, - required String recognizedText, - this.isVisible = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - x1 = Value(x1), - y1 = Value(y1), - x2 = Value(x2), - y2 = Value(y2), - x3 = Value(x3), - y3 = Value(y3), - x4 = Value(x4), - y4 = Value(y4), - boxScore = Value(boxScore), - textScore = Value(textScore), - recognizedText = Value(recognizedText); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? x1, - Expression? y1, - Expression? x2, - Expression? y2, - Expression? x3, - Expression? y3, - Expression? x4, - Expression? y4, - Expression? boxScore, - Expression? textScore, - Expression? recognizedText, - Expression? isVisible, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (x1 != null) 'x1': x1, - if (y1 != null) 'y1': y1, - if (x2 != null) 'x2': x2, - if (y2 != null) 'y2': y2, - if (x3 != null) 'x3': x3, - if (y3 != null) 'y3': y3, - if (x4 != null) 'x4': x4, - if (y4 != null) 'y4': y4, - if (boxScore != null) 'box_score': boxScore, - if (textScore != null) 'text_score': textScore, - if (recognizedText != null) 'recognized_text': recognizedText, - if (isVisible != null) 'is_visible': isVisible, - }); - } - - AssetOcrEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? x1, - Value? y1, - Value? x2, - Value? y2, - Value? x3, - Value? y3, - Value? x4, - Value? y4, - Value? boxScore, - Value? textScore, - Value? recognizedText, - Value? isVisible, - }) { - return AssetOcrEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (x1.present) { - map['x1'] = Variable(x1.value); - } - if (y1.present) { - map['y1'] = Variable(y1.value); - } - if (x2.present) { - map['x2'] = Variable(x2.value); - } - if (y2.present) { - map['y2'] = Variable(y2.value); - } - if (x3.present) { - map['x3'] = Variable(x3.value); - } - if (y3.present) { - map['y3'] = Variable(y3.value); - } - if (x4.present) { - map['x4'] = Variable(x4.value); - } - if (y4.present) { - map['y4'] = Variable(y4.value); - } - if (boxScore.present) { - map['box_score'] = Variable(boxScore.value); - } - if (textScore.present) { - map['text_score'] = Variable(textScore.value); - } - if (recognizedText.present) { - map['recognized_text'] = Variable(recognizedText.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV30 extends GeneratedDatabase { - DatabaseAtV30(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxLocalAssetCreatedAt = Index( - 'idx_local_asset_created_at', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_created_at ON local_asset_entity (created_at)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Settings settings = Settings(this); - late final AssetOcrEntity assetOcrEntity = AssetOcrEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - late final Index idxAssetOcrAssetId = Index( - 'idx_asset_ocr_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_ocr_asset_id ON asset_ocr_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxLocalAssetCreatedAt, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - settings, - assetOcrEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - idxAssetOcrAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_ocr_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 30; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v31.dart b/mobile/test/drift/main/generated/schema_v31.dart deleted file mode 100644 index 06db7e3081..0000000000 --- a/mobile/test/drift/main/generated/schema_v31.dart +++ /dev/null @@ -1,10032 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final String email; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - const UserEntityData({ - required this.id, - required this.name, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - String? email, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - hasProfileImage, - profileChangedAt, - avatarColor, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn localDateTime = GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn uploadedAt = GeneratedColumn( - 'uploaded_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isEdited = GeneratedColumn( - 'is_edited', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_edited IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - uploadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}uploaded_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - isEdited: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_edited'], - )!, - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String checksum; - final int isFavorite; - final String ownerId; - final String? localDateTime; - final String? thumbHash; - final String? deletedAt; - final String? uploadedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - final int isEdited; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.uploadedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - required this.isEdited, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || uploadedAt != null) { - map['uploaded_at'] = Variable(uploadedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - map['is_edited'] = Variable(isEdited); - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - uploadedAt: serializer.fromJson(json['uploadedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - isEdited: serializer.fromJson(json['isEdited']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'uploadedAt': serializer.toJson(uploadedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - 'isEdited': serializer.toJson(isEdited), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? checksum, - int? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value uploadedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - int? isEdited, - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - uploadedAt: uploadedAt.present ? uploadedAt.value : this.uploadedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - uploadedAt: data.uploadedAt.present - ? data.uploadedAt.value - : this.uploadedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - uploadedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - isEdited, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.uploadedAt == this.uploadedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId && - other.isEdited == this.isEdited); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value uploadedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - final Value isEdited; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.uploadedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - this.isEdited = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? uploadedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - Expression? isEdited, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (uploadedAt != null) 'uploaded_at': uploadedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - if (isEdited != null) 'is_edited': isEdited, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? uploadedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - Value? isEdited, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - uploadedAt: uploadedAt ?? this.uploadedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - isEdited: isEdited ?? this.isEdited, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (uploadedAt.present) { - map['uploaded_at'] = Variable(uploadedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - if (isEdited.present) { - map['is_edited'] = Variable(isEdited.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('uploadedAt: $uploadedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId, ') - ..write('isEdited: $isEdited') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn iCloudId = GeneratedColumn( - 'i_cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - iCloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}i_cloud_id'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String? checksum; - final int isFavorite; - final int orientation; - final String? iCloudId; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - final int playbackStyle; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - this.iCloudId, - this.adjustmentTime, - this.latitude, - this.longitude, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - if (!nullToAbsent || iCloudId != null) { - map['i_cloud_id'] = Variable(iCloudId); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - iCloudId: serializer.fromJson(json['iCloudId']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'iCloudId': serializer.toJson(iCloudId), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - Value iCloudId = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - int? playbackStyle, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - checksum, - isFavorite, - orientation, - iCloudId, - adjustmentTime, - latitude, - longitude, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.iCloudId == this.iCloudId && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.playbackStyle == this.playbackStyle); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value iCloudId; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - final Value playbackStyle; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.iCloudId = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? iCloudId, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (iCloudId != null) 'i_cloud_id': iCloudId, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? iCloudId, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - Value? playbackStyle, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - iCloudId: iCloudId ?? this.iCloudId, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (iCloudId.present) { - map['i_cloud_id'] = Variable(iCloudId.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('iCloudId: $iCloudId, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT \'\'', - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_asset_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 1 CHECK (is_activity_enabled IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final String createdAt; - final String updatedAt; - final String? thumbnailAssetId; - final int isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - String? createdAt, - String? updatedAt, - Value thumbnailAssetId = const Value.absent(), - int? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (is_ios_shared_album IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: - 'NULL REFERENCES remote_album_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String updatedAt; - final int backupSelection; - final int isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final int? marker; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - String? updatedAt, - int? backupSelection, - int? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker == this.marker); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES local_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn marker = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL CHECK (marker IN (0, 1))', - ); - @override - List get $columns => [assetId, albumId, marker]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - marker: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - final int? marker; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - this.marker, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || marker != null) { - map['marker'] = Variable(marker); - } - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - marker: serializer.fromJson(json['marker']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - 'marker': serializer.toJson(marker), - }; - } - - LocalAlbumAssetEntityData copyWith({ - String? assetId, - String? albumId, - Value marker = const Value.absent(), - }) => LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker.present ? marker.value : this.marker, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - marker: data.marker.present ? data.marker.value : this.marker, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId, marker); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId && - other.marker == this.marker); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - final Value marker; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - this.marker = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - this.marker = const Value.absent(), - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - Expression? marker, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - if (marker != null) 'marker': marker, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - Value? marker, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - marker: marker ?? this.marker, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (marker.present) { - map['marker'] = Variable(marker.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId, ') - ..write('marker: $marker') - ..write(')')) - .toString(); - } -} - -class AuthUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AuthUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_admin IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: - 'NOT NULL DEFAULT 0 CHECK (has_profile_image IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn avatarColor = GeneratedColumn( - 'avatar_color', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn pinCode = GeneratedColumn( - 'pin_code', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'auth_user_entity'; - @override - Set get $primaryKey => {id}; - @override - AuthUserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AuthUserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_admin'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_changed_at'], - )!, - avatarColor: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}avatar_color'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - )!, - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - pinCode: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}pin_code'], - ), - ); - } - - @override - AuthUserEntity createAlias(String alias) { - return AuthUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AuthUserEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String email; - final int isAdmin; - final int hasProfileImage; - final String profileChangedAt; - final int avatarColor; - final int quotaSizeInBytes; - final int quotaUsageInBytes; - final String? pinCode; - const AuthUserEntityData({ - required this.id, - required this.name, - required this.email, - required this.isAdmin, - required this.hasProfileImage, - required this.profileChangedAt, - required this.avatarColor, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - this.pinCode, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['email'] = Variable(email); - map['is_admin'] = Variable(isAdmin); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['avatar_color'] = Variable(avatarColor); - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - if (!nullToAbsent || pinCode != null) { - map['pin_code'] = Variable(pinCode); - } - return map; - } - - factory AuthUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AuthUserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - email: serializer.fromJson(json['email']), - isAdmin: serializer.fromJson(json['isAdmin']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - avatarColor: serializer.fromJson(json['avatarColor']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - pinCode: serializer.fromJson(json['pinCode']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'email': serializer.toJson(email), - 'isAdmin': serializer.toJson(isAdmin), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'avatarColor': serializer.toJson(avatarColor), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - 'pinCode': serializer.toJson(pinCode), - }; - } - - AuthUserEntityData copyWith({ - String? id, - String? name, - String? email, - int? isAdmin, - int? hasProfileImage, - String? profileChangedAt, - int? avatarColor, - int? quotaSizeInBytes, - int? quotaUsageInBytes, - Value pinCode = const Value.absent(), - }) => AuthUserEntityData( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode.present ? pinCode.value : this.pinCode, - ); - AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) { - return AuthUserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - email: data.email.present ? data.email.value : this.email, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - avatarColor: data.avatarColor.present - ? data.avatarColor.value - : this.avatarColor, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode, - ); - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - email, - isAdmin, - hasProfileImage, - profileChangedAt, - avatarColor, - quotaSizeInBytes, - quotaUsageInBytes, - pinCode, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AuthUserEntityData && - other.id == this.id && - other.name == this.name && - other.email == this.email && - other.isAdmin == this.isAdmin && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.avatarColor == this.avatarColor && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes && - other.pinCode == this.pinCode); -} - -class AuthUserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value email; - final Value isAdmin; - final Value hasProfileImage; - final Value profileChangedAt; - final Value avatarColor; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - final Value pinCode; - const AuthUserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.email = const Value.absent(), - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.avatarColor = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }); - AuthUserEntityCompanion.insert({ - required String id, - required String name, - required String email, - this.isAdmin = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - required int avatarColor, - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - this.pinCode = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email), - avatarColor = Value(avatarColor); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? email, - Expression? isAdmin, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? avatarColor, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - Expression? pinCode, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (email != null) 'email': email, - if (isAdmin != null) 'is_admin': isAdmin, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (avatarColor != null) 'avatar_color': avatarColor, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - if (pinCode != null) 'pin_code': pinCode, - }); - } - - AuthUserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? email, - Value? isAdmin, - Value? hasProfileImage, - Value? profileChangedAt, - Value? avatarColor, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - Value? pinCode, - }) { - return AuthUserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - email: email ?? this.email, - isAdmin: isAdmin ?? this.isAdmin, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - avatarColor: avatarColor ?? this.avatarColor, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - pinCode: pinCode ?? this.pinCode, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (avatarColor.present) { - map['avatar_color'] = Variable(avatarColor.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - if (pinCode.present) { - map['pin_code'] = Variable(pinCode.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AuthUserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('email: $email, ') - ..write('isAdmin: $isAdmin, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('avatarColor: $avatarColor, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes, ') - ..write('pinCode: $pinCode') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(user_id, "key")']; - @override - bool get dontWriteConstraints => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (in_timeline IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(shared_by_id, shared_with_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final int inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - int? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn dateTimeOriginal = GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final String? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson(json['dateTimeOriginal']), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, album_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_album_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(album_id, user_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class RemoteAssetCloudIdEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn cloudId = GeneratedColumn( - 'cloud_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn adjustmentTime = GeneratedColumn( - 'adjustment_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_cloud_id_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteAssetCloudIdEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetCloudIdEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - cloudId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cloud_id'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - ), - adjustmentTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}adjustment_time'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - ); - } - - @override - RemoteAssetCloudIdEntity createAlias(String alias) { - return RemoteAssetCloudIdEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(asset_id)']; - @override - bool get dontWriteConstraints => true; -} - -class RemoteAssetCloudIdEntityData extends DataClass - implements Insertable { - final String assetId; - final String? cloudId; - final String? createdAt; - final String? adjustmentTime; - final double? latitude; - final double? longitude; - const RemoteAssetCloudIdEntityData({ - required this.assetId, - this.cloudId, - this.createdAt, - this.adjustmentTime, - this.latitude, - this.longitude, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || cloudId != null) { - map['cloud_id'] = Variable(cloudId); - } - if (!nullToAbsent || createdAt != null) { - map['created_at'] = Variable(createdAt); - } - if (!nullToAbsent || adjustmentTime != null) { - map['adjustment_time'] = Variable(adjustmentTime); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - return map; - } - - factory RemoteAssetCloudIdEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetCloudIdEntityData( - assetId: serializer.fromJson(json['assetId']), - cloudId: serializer.fromJson(json['cloudId']), - createdAt: serializer.fromJson(json['createdAt']), - adjustmentTime: serializer.fromJson(json['adjustmentTime']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'cloudId': serializer.toJson(cloudId), - 'createdAt': serializer.toJson(createdAt), - 'adjustmentTime': serializer.toJson(adjustmentTime), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - }; - } - - RemoteAssetCloudIdEntityData copyWith({ - String? assetId, - Value cloudId = const Value.absent(), - Value createdAt = const Value.absent(), - Value adjustmentTime = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - }) => RemoteAssetCloudIdEntityData( - assetId: assetId ?? this.assetId, - cloudId: cloudId.present ? cloudId.value : this.cloudId, - createdAt: createdAt.present ? createdAt.value : this.createdAt, - adjustmentTime: adjustmentTime.present - ? adjustmentTime.value - : this.adjustmentTime, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - ); - RemoteAssetCloudIdEntityData copyWithCompanion( - RemoteAssetCloudIdEntityCompanion data, - ) { - return RemoteAssetCloudIdEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - adjustmentTime: data.adjustmentTime.present - ? data.adjustmentTime.value - : this.adjustmentTime, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityData(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - assetId, - cloudId, - createdAt, - adjustmentTime, - latitude, - longitude, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetCloudIdEntityData && - other.assetId == this.assetId && - other.cloudId == this.cloudId && - other.createdAt == this.createdAt && - other.adjustmentTime == this.adjustmentTime && - other.latitude == this.latitude && - other.longitude == this.longitude); -} - -class RemoteAssetCloudIdEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value cloudId; - final Value createdAt; - final Value adjustmentTime; - final Value latitude; - final Value longitude; - const RemoteAssetCloudIdEntityCompanion({ - this.assetId = const Value.absent(), - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }); - RemoteAssetCloudIdEntityCompanion.insert({ - required String assetId, - this.cloudId = const Value.absent(), - this.createdAt = const Value.absent(), - this.adjustmentTime = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? cloudId, - Expression? createdAt, - Expression? adjustmentTime, - Expression? latitude, - Expression? longitude, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (cloudId != null) 'cloud_id': cloudId, - if (createdAt != null) 'created_at': createdAt, - if (adjustmentTime != null) 'adjustment_time': adjustmentTime, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - }); - } - - RemoteAssetCloudIdEntityCompanion copyWith({ - Value? assetId, - Value? cloudId, - Value? createdAt, - Value? adjustmentTime, - Value? latitude, - Value? longitude, - }) { - return RemoteAssetCloudIdEntityCompanion( - assetId: assetId ?? this.assetId, - cloudId: cloudId ?? this.cloudId, - createdAt: createdAt ?? this.createdAt, - adjustmentTime: adjustmentTime ?? this.adjustmentTime, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (cloudId.present) { - map['cloud_id'] = Variable(cloudId.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (adjustmentTime.present) { - map['adjustment_time'] = Variable(adjustmentTime.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetCloudIdEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('cloudId: $cloudId, ') - ..write('createdAt: $createdAt, ') - ..write('adjustmentTime: $adjustmentTime, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_saved IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String? deletedAt; - final String ownerId; - final int type; - final String data; - final int isSaved; - final String memoryAt; - final String? seenAt; - final String? showAt; - final String? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - int? isSaved, - String? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required String memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES memory_entity(id)ON DELETE CASCADE', - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const [ - 'PRIMARY KEY(asset_id, memory_id)', - ]; - @override - bool get dontWriteConstraints => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES user_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_favorite IN (0, 1))', - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL CHECK (is_hidden IN (0, 1))', - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final String createdAt; - final String updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final int isFavorite; - final int isHidden; - final String? color; - final String? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - String? createdAt, - String? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - int? isFavorite, - int? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required int isFavorite, - required int isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL REFERENCES person_entity(id)ON DELETE SET NULL', - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}deleted_at'], - ), - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - final int isVisible; - final String? deletedAt; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - required this.isVisible, - this.deletedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - map['is_visible'] = Variable(isVisible); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - isVisible: serializer.fromJson(json['isVisible']), - deletedAt: serializer.fromJson(json['deletedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - 'isVisible': serializer.toJson(isVisible), - 'deletedAt': serializer.toJson(deletedAt), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - int? isVisible, - Value deletedAt = const Value.absent(), - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - isVisible, - deletedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType && - other.isVisible == this.isVisible && - other.deletedAt == this.deletedAt); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - final Value isVisible; - final Value deletedAt; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - this.isVisible = const Value.absent(), - this.deletedAt = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - Expression? isVisible, - Expression? deletedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - if (isVisible != null) 'is_visible': isVisible, - if (deletedAt != null) 'deleted_at': deletedAt, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - Value? isVisible, - Value? deletedAt, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - isVisible: isVisible ?? this.isVisible, - deletedAt: deletedAt ?? this.deletedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType, ') - ..write('isVisible: $isVisible, ') - ..write('deletedAt: $deletedAt') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class TrashedLocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn durationMs = GeneratedColumn( - 'duration_ms', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0 CHECK (is_favorite IN (0, 1))', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn source = GeneratedColumn( - 'source', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn playbackStyle = GeneratedColumn( - 'playback_style', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 0', - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'trashed_local_asset_entity'; - @override - Set get $primaryKey => {id, albumId}; - @override - TrashedLocalAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrashedLocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationMs: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_ms'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - source: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}source'], - )!, - playbackStyle: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}playback_style'], - )!, - ); - } - - @override - TrashedLocalAssetEntity createAlias(String alias) { - return TrashedLocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id, album_id)']; - @override - bool get dontWriteConstraints => true; -} - -class TrashedLocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final String createdAt; - final String updatedAt; - final int? width; - final int? height; - final int? durationMs; - final String id; - final String albumId; - final String? checksum; - final int isFavorite; - final int orientation; - final int source; - final int playbackStyle; - const TrashedLocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationMs, - required this.id, - required this.albumId, - this.checksum, - required this.isFavorite, - required this.orientation, - required this.source, - required this.playbackStyle, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationMs != null) { - map['duration_ms'] = Variable(durationMs); - } - map['id'] = Variable(id); - map['album_id'] = Variable(albumId); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - map['source'] = Variable(source); - map['playback_style'] = Variable(playbackStyle); - return map; - } - - factory TrashedLocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrashedLocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationMs: serializer.fromJson(json['durationMs']), - id: serializer.fromJson(json['id']), - albumId: serializer.fromJson(json['albumId']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - source: serializer.fromJson(json['source']), - playbackStyle: serializer.fromJson(json['playbackStyle']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationMs': serializer.toJson(durationMs), - 'id': serializer.toJson(id), - 'albumId': serializer.toJson(albumId), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - 'source': serializer.toJson(source), - 'playbackStyle': serializer.toJson(playbackStyle), - }; - } - - TrashedLocalAssetEntityData copyWith({ - String? name, - int? type, - String? createdAt, - String? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationMs = const Value.absent(), - String? id, - String? albumId, - Value checksum = const Value.absent(), - int? isFavorite, - int? orientation, - int? source, - int? playbackStyle, - }) => TrashedLocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationMs: durationMs.present ? durationMs.value : this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - TrashedLocalAssetEntityData copyWithCompanion( - TrashedLocalAssetEntityCompanion data, - ) { - return TrashedLocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationMs: data.durationMs.present - ? data.durationMs.value - : this.durationMs, - id: data.id.present ? data.id.value : this.id, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - source: data.source.present ? data.source.value : this.source, - playbackStyle: data.playbackStyle.present - ? data.playbackStyle.value - : this.playbackStyle, - ); - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationMs, - id, - albumId, - checksum, - isFavorite, - orientation, - source, - playbackStyle, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrashedLocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationMs == this.durationMs && - other.id == this.id && - other.albumId == this.albumId && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation && - other.source == this.source && - other.playbackStyle == this.playbackStyle); -} - -class TrashedLocalAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationMs; - final Value id; - final Value albumId; - final Value checksum; - final Value isFavorite; - final Value orientation; - final Value source; - final Value playbackStyle; - const TrashedLocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - this.id = const Value.absent(), - this.albumId = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - this.source = const Value.absent(), - this.playbackStyle = const Value.absent(), - }); - TrashedLocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationMs = const Value.absent(), - required String id, - required String albumId, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - required int source, - this.playbackStyle = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - albumId = Value(albumId), - source = Value(source); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationMs, - Expression? id, - Expression? albumId, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - Expression? source, - Expression? playbackStyle, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationMs != null) 'duration_ms': durationMs, - if (id != null) 'id': id, - if (albumId != null) 'album_id': albumId, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - if (source != null) 'source': source, - if (playbackStyle != null) 'playback_style': playbackStyle, - }); - } - - TrashedLocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationMs, - Value? id, - Value? albumId, - Value? checksum, - Value? isFavorite, - Value? orientation, - Value? source, - Value? playbackStyle, - }) { - return TrashedLocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationMs: durationMs ?? this.durationMs, - id: id ?? this.id, - albumId: albumId ?? this.albumId, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - source: source ?? this.source, - playbackStyle: playbackStyle ?? this.playbackStyle, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationMs.present) { - map['duration_ms'] = Variable(durationMs.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (source.present) { - map['source'] = Variable(source.value); - } - if (playbackStyle.present) { - map['playback_style'] = Variable(playbackStyle.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrashedLocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationMs: $durationMs, ') - ..write('id: $id, ') - ..write('albumId: $albumId, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation, ') - ..write('source: $source, ') - ..write('playbackStyle: $playbackStyle') - ..write(')')) - .toString(); - } -} - -class AssetEditEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetEditEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn action = GeneratedColumn( - 'action', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn parameters = - GeneratedColumn( - 'parameters', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn sequence = GeneratedColumn( - 'sequence', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [ - id, - assetId, - action, - parameters, - sequence, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_edit_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetEditEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetEditEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - action: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}action'], - )!, - parameters: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}parameters'], - )!, - sequence: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sequence'], - )!, - ); - } - - @override - AssetEditEntity createAlias(String alias) { - return AssetEditEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetEditEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final int action; - final i2.Uint8List parameters; - final int sequence; - const AssetEditEntityData({ - required this.id, - required this.assetId, - required this.action, - required this.parameters, - required this.sequence, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['action'] = Variable(action); - map['parameters'] = Variable(parameters); - map['sequence'] = Variable(sequence); - return map; - } - - factory AssetEditEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetEditEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - action: serializer.fromJson(json['action']), - parameters: serializer.fromJson(json['parameters']), - sequence: serializer.fromJson(json['sequence']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'action': serializer.toJson(action), - 'parameters': serializer.toJson(parameters), - 'sequence': serializer.toJson(sequence), - }; - } - - AssetEditEntityData copyWith({ - String? id, - String? assetId, - int? action, - i2.Uint8List? parameters, - int? sequence, - }) => AssetEditEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - AssetEditEntityData copyWithCompanion(AssetEditEntityCompanion data) { - return AssetEditEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - action: data.action.present ? data.action.value : this.action, - parameters: data.parameters.present - ? data.parameters.value - : this.parameters, - sequence: data.sequence.present ? data.sequence.value : this.sequence, - ); - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - action, - $driftBlobEquality.hash(parameters), - sequence, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetEditEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.action == this.action && - $driftBlobEquality.equals(other.parameters, this.parameters) && - other.sequence == this.sequence); -} - -class AssetEditEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value action; - final Value parameters; - final Value sequence; - const AssetEditEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.action = const Value.absent(), - this.parameters = const Value.absent(), - this.sequence = const Value.absent(), - }); - AssetEditEntityCompanion.insert({ - required String id, - required String assetId, - required int action, - required i2.Uint8List parameters, - required int sequence, - }) : id = Value(id), - assetId = Value(assetId), - action = Value(action), - parameters = Value(parameters), - sequence = Value(sequence); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? action, - Expression? parameters, - Expression? sequence, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (action != null) 'action': action, - if (parameters != null) 'parameters': parameters, - if (sequence != null) 'sequence': sequence, - }); - } - - AssetEditEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? action, - Value? parameters, - Value? sequence, - }) { - return AssetEditEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - action: action ?? this.action, - parameters: parameters ?? this.parameters, - sequence: sequence ?? this.sequence, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (action.present) { - map['action'] = Variable(action.value); - } - if (parameters.present) { - map['parameters'] = Variable(parameters.value); - } - if (sequence.present) { - map['sequence'] = Variable(sequence.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetEditEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('action: $action, ') - ..write('parameters: $parameters, ') - ..write('sequence: $sequence') - ..write(')')) - .toString(); - } -} - -class Settings extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Settings(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NULL', - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT CURRENT_TIMESTAMP', - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [key, value, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'settings'; - @override - Set get $primaryKey => {key}; - @override - SettingsData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return SettingsData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}value'], - ), - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - Settings createAlias(String alias) { - return Settings(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY("key")']; - @override - bool get dontWriteConstraints => true; -} - -class SettingsData extends DataClass implements Insertable { - final String key; - final String? value; - final String updatedAt; - const SettingsData({required this.key, this.value, required this.updatedAt}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - if (!nullToAbsent || value != null) { - map['value'] = Variable(value); - } - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory SettingsData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return SettingsData( - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - SettingsData copyWith({ - String? key, - Value value = const Value.absent(), - String? updatedAt, - }) => SettingsData( - key: key ?? this.key, - value: value.present ? value.value : this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - SettingsData copyWithCompanion(SettingsCompanion data) { - return SettingsData( - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('SettingsData(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, value, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is SettingsData && - other.key == this.key && - other.value == this.value && - other.updatedAt == this.updatedAt); -} - -class SettingsCompanion extends UpdateCompanion { - final Value key; - final Value value; - final Value updatedAt; - const SettingsCompanion({ - this.key = const Value.absent(), - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - SettingsCompanion.insert({ - required String key, - this.value = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : key = Value(key); - static Insertable custom({ - Expression? key, - Expression? value, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (value != null) 'value': value, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - SettingsCompanion copyWith({ - Value? key, - Value? value, - Value? updatedAt, - }) { - return SettingsCompanion( - key: key ?? this.key, - value: value ?? this.value, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingsCompanion(') - ..write('key: $key, ') - ..write('value: $value, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class AssetOcrEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetOcrEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'NOT NULL REFERENCES remote_asset_entity(id)ON DELETE CASCADE', - ); - late final GeneratedColumn x1 = GeneratedColumn( - 'x1', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y1 = GeneratedColumn( - 'y1', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x2 = GeneratedColumn( - 'x2', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y2 = GeneratedColumn( - 'y2', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x3 = GeneratedColumn( - 'x3', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y3 = GeneratedColumn( - 'y3', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn x4 = GeneratedColumn( - 'x4', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn y4 = GeneratedColumn( - 'y4', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn boxScore = GeneratedColumn( - 'box_score', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn textScore = GeneratedColumn( - 'text_score', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn recognizedText = GeneratedColumn( - 'recognized_text', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn isVisible = GeneratedColumn( - 'is_visible', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'NOT NULL DEFAULT 1 CHECK (is_visible IN (0, 1))', - defaultValue: const CustomExpression('1'), - ); - @override - List get $columns => [ - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_ocr_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetOcrEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetOcrEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - x1: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x1'], - )!, - y1: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y1'], - )!, - x2: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x2'], - )!, - y2: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y2'], - )!, - x3: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x3'], - )!, - y3: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y3'], - )!, - x4: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}x4'], - )!, - y4: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}y4'], - )!, - boxScore: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}box_score'], - )!, - textScore: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}text_score'], - )!, - recognizedText: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}recognized_text'], - )!, - isVisible: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}is_visible'], - )!, - ); - } - - @override - AssetOcrEntity createAlias(String alias) { - return AssetOcrEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; - @override - List get customConstraints => const ['PRIMARY KEY(id)']; - @override - bool get dontWriteConstraints => true; -} - -class AssetOcrEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final double x1; - final double y1; - final double x2; - final double y2; - final double x3; - final double y3; - final double x4; - final double y4; - final double boxScore; - final double textScore; - final String recognizedText; - final int isVisible; - const AssetOcrEntityData({ - required this.id, - required this.assetId, - required this.x1, - required this.y1, - required this.x2, - required this.y2, - required this.x3, - required this.y3, - required this.x4, - required this.y4, - required this.boxScore, - required this.textScore, - required this.recognizedText, - required this.isVisible, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - map['x1'] = Variable(x1); - map['y1'] = Variable(y1); - map['x2'] = Variable(x2); - map['y2'] = Variable(y2); - map['x3'] = Variable(x3); - map['y3'] = Variable(y3); - map['x4'] = Variable(x4); - map['y4'] = Variable(y4); - map['box_score'] = Variable(boxScore); - map['text_score'] = Variable(textScore); - map['recognized_text'] = Variable(recognizedText); - map['is_visible'] = Variable(isVisible); - return map; - } - - factory AssetOcrEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetOcrEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - x1: serializer.fromJson(json['x1']), - y1: serializer.fromJson(json['y1']), - x2: serializer.fromJson(json['x2']), - y2: serializer.fromJson(json['y2']), - x3: serializer.fromJson(json['x3']), - y3: serializer.fromJson(json['y3']), - x4: serializer.fromJson(json['x4']), - y4: serializer.fromJson(json['y4']), - boxScore: serializer.fromJson(json['boxScore']), - textScore: serializer.fromJson(json['textScore']), - recognizedText: serializer.fromJson(json['recognizedText']), - isVisible: serializer.fromJson(json['isVisible']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'x1': serializer.toJson(x1), - 'y1': serializer.toJson(y1), - 'x2': serializer.toJson(x2), - 'y2': serializer.toJson(y2), - 'x3': serializer.toJson(x3), - 'y3': serializer.toJson(y3), - 'x4': serializer.toJson(x4), - 'y4': serializer.toJson(y4), - 'boxScore': serializer.toJson(boxScore), - 'textScore': serializer.toJson(textScore), - 'recognizedText': serializer.toJson(recognizedText), - 'isVisible': serializer.toJson(isVisible), - }; - } - - AssetOcrEntityData copyWith({ - String? id, - String? assetId, - double? x1, - double? y1, - double? x2, - double? y2, - double? x3, - double? y3, - double? x4, - double? y4, - double? boxScore, - double? textScore, - String? recognizedText, - int? isVisible, - }) => AssetOcrEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - AssetOcrEntityData copyWithCompanion(AssetOcrEntityCompanion data) { - return AssetOcrEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - x1: data.x1.present ? data.x1.value : this.x1, - y1: data.y1.present ? data.y1.value : this.y1, - x2: data.x2.present ? data.x2.value : this.x2, - y2: data.y2.present ? data.y2.value : this.y2, - x3: data.x3.present ? data.x3.value : this.x3, - y3: data.y3.present ? data.y3.value : this.y3, - x4: data.x4.present ? data.x4.value : this.x4, - y4: data.y4.present ? data.y4.value : this.y4, - boxScore: data.boxScore.present ? data.boxScore.value : this.boxScore, - textScore: data.textScore.present ? data.textScore.value : this.textScore, - recognizedText: data.recognizedText.present - ? data.recognizedText.value - : this.recognizedText, - isVisible: data.isVisible.present ? data.isVisible.value : this.isVisible, - ); - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - x1, - y1, - x2, - y2, - x3, - y3, - x4, - y4, - boxScore, - textScore, - recognizedText, - isVisible, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetOcrEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.x1 == this.x1 && - other.y1 == this.y1 && - other.x2 == this.x2 && - other.y2 == this.y2 && - other.x3 == this.x3 && - other.y3 == this.y3 && - other.x4 == this.x4 && - other.y4 == this.y4 && - other.boxScore == this.boxScore && - other.textScore == this.textScore && - other.recognizedText == this.recognizedText && - other.isVisible == this.isVisible); -} - -class AssetOcrEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value x1; - final Value y1; - final Value x2; - final Value y2; - final Value x3; - final Value y3; - final Value x4; - final Value y4; - final Value boxScore; - final Value textScore; - final Value recognizedText; - final Value isVisible; - const AssetOcrEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.x1 = const Value.absent(), - this.y1 = const Value.absent(), - this.x2 = const Value.absent(), - this.y2 = const Value.absent(), - this.x3 = const Value.absent(), - this.y3 = const Value.absent(), - this.x4 = const Value.absent(), - this.y4 = const Value.absent(), - this.boxScore = const Value.absent(), - this.textScore = const Value.absent(), - this.recognizedText = const Value.absent(), - this.isVisible = const Value.absent(), - }); - AssetOcrEntityCompanion.insert({ - required String id, - required String assetId, - required double x1, - required double y1, - required double x2, - required double y2, - required double x3, - required double y3, - required double x4, - required double y4, - required double boxScore, - required double textScore, - required String recognizedText, - this.isVisible = const Value.absent(), - }) : id = Value(id), - assetId = Value(assetId), - x1 = Value(x1), - y1 = Value(y1), - x2 = Value(x2), - y2 = Value(y2), - x3 = Value(x3), - y3 = Value(y3), - x4 = Value(x4), - y4 = Value(y4), - boxScore = Value(boxScore), - textScore = Value(textScore), - recognizedText = Value(recognizedText); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? x1, - Expression? y1, - Expression? x2, - Expression? y2, - Expression? x3, - Expression? y3, - Expression? x4, - Expression? y4, - Expression? boxScore, - Expression? textScore, - Expression? recognizedText, - Expression? isVisible, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (x1 != null) 'x1': x1, - if (y1 != null) 'y1': y1, - if (x2 != null) 'x2': x2, - if (y2 != null) 'y2': y2, - if (x3 != null) 'x3': x3, - if (y3 != null) 'y3': y3, - if (x4 != null) 'x4': x4, - if (y4 != null) 'y4': y4, - if (boxScore != null) 'box_score': boxScore, - if (textScore != null) 'text_score': textScore, - if (recognizedText != null) 'recognized_text': recognizedText, - if (isVisible != null) 'is_visible': isVisible, - }); - } - - AssetOcrEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? x1, - Value? y1, - Value? x2, - Value? y2, - Value? x3, - Value? y3, - Value? x4, - Value? y4, - Value? boxScore, - Value? textScore, - Value? recognizedText, - Value? isVisible, - }) { - return AssetOcrEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - x1: x1 ?? this.x1, - y1: y1 ?? this.y1, - x2: x2 ?? this.x2, - y2: y2 ?? this.y2, - x3: x3 ?? this.x3, - y3: y3 ?? this.y3, - x4: x4 ?? this.x4, - y4: y4 ?? this.y4, - boxScore: boxScore ?? this.boxScore, - textScore: textScore ?? this.textScore, - recognizedText: recognizedText ?? this.recognizedText, - isVisible: isVisible ?? this.isVisible, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (x1.present) { - map['x1'] = Variable(x1.value); - } - if (y1.present) { - map['y1'] = Variable(y1.value); - } - if (x2.present) { - map['x2'] = Variable(x2.value); - } - if (y2.present) { - map['y2'] = Variable(y2.value); - } - if (x3.present) { - map['x3'] = Variable(x3.value); - } - if (y3.present) { - map['y3'] = Variable(y3.value); - } - if (x4.present) { - map['x4'] = Variable(x4.value); - } - if (y4.present) { - map['y4'] = Variable(y4.value); - } - if (boxScore.present) { - map['box_score'] = Variable(boxScore.value); - } - if (textScore.present) { - map['text_score'] = Variable(textScore.value); - } - if (recognizedText.present) { - map['recognized_text'] = Variable(recognizedText.value); - } - if (isVisible.present) { - map['is_visible'] = Variable(isVisible.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetOcrEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('x1: $x1, ') - ..write('y1: $y1, ') - ..write('x2: $x2, ') - ..write('y2: $y2, ') - ..write('x3: $x3, ') - ..write('y3: $y3, ') - ..write('x4: $x4, ') - ..write('y4: $y4, ') - ..write('boxScore: $boxScore, ') - ..write('textScore: $textScore, ') - ..write('recognizedText: $recognizedText, ') - ..write('isVisible: $isVisible') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV31 extends GeneratedDatabase { - DatabaseAtV31(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAlbumAssetAlbumAsset = Index( - 'idx_local_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_local_album_asset_album_asset ON local_album_asset_entity (album_id, asset_id)', - ); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxLocalAssetCloudId = Index( - 'idx_local_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)', - ); - late final Index idxLocalAssetCreatedAt = Index( - 'idx_local_asset_created_at', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_created_at ON local_asset_entity (created_at)', - ); - late final Index idxStackPrimaryAssetId = Index( - 'idx_stack_primary_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_stack_primary_asset_id ON stack_entity (primary_asset_id)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final Index idxRemoteAssetStackId = Index( - 'idx_remote_asset_stack_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_stack_id ON remote_asset_entity (stack_id)', - ); - late final Index idxRemoteAssetOwnerVisibilityDeletedCreated = Index( - 'idx_remote_asset_owner_visibility_deleted_created', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_visibility_deleted_created ON remote_asset_entity (owner_id, visibility, deleted_at, created_at DESC)', - ); - late final Index idxRemoteAssetUploaded = Index( - 'idx_remote_asset_uploaded', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_uploaded ON remote_asset_entity (uploaded_at)', - ); - late final AuthUserEntity authUserEntity = AuthUserEntity(this); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity = - RemoteAssetCloudIdEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final TrashedLocalAssetEntity trashedLocalAssetEntity = - TrashedLocalAssetEntity(this); - late final AssetEditEntity assetEditEntity = AssetEditEntity(this); - late final Settings settings = Settings(this); - late final AssetOcrEntity assetOcrEntity = AssetOcrEntity(this); - late final Index idxPartnerSharedWithId = Index( - 'idx_partner_shared_with_id', - 'CREATE INDEX IF NOT EXISTS idx_partner_shared_with_id ON partner_entity (shared_with_id)', - ); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - late final Index idxRemoteExifCity = Index( - 'idx_remote_exif_city', - 'CREATE INDEX IF NOT EXISTS idx_remote_exif_city ON remote_exif_entity (city) WHERE city IS NOT NULL', - ); - late final Index idxRemoteAlbumAssetAlbumAsset = Index( - 'idx_remote_album_asset_album_asset', - 'CREATE INDEX IF NOT EXISTS idx_remote_album_asset_album_asset ON remote_album_asset_entity (album_id, asset_id)', - ); - late final Index idxRemoteAssetCloudId = Index( - 'idx_remote_asset_cloud_id', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_cloud_id ON remote_asset_cloud_id_entity (cloud_id)', - ); - late final Index idxPersonOwnerId = Index( - 'idx_person_owner_id', - 'CREATE INDEX IF NOT EXISTS idx_person_owner_id ON person_entity (owner_id)', - ); - late final Index idxAssetFacePersonId = Index( - 'idx_asset_face_person_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_person_id ON asset_face_entity (person_id)', - ); - late final Index idxAssetFaceAssetId = Index( - 'idx_asset_face_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_asset_id ON asset_face_entity (asset_id)', - ); - late final Index idxAssetFaceVisiblePerson = Index( - 'idx_asset_face_visible_person', - 'CREATE INDEX IF NOT EXISTS idx_asset_face_visible_person ON asset_face_entity (person_id, asset_id) WHERE is_visible = 1 AND deleted_at IS NULL', - ); - late final Index idxTrashedLocalAssetChecksum = Index( - 'idx_trashed_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)', - ); - late final Index idxTrashedLocalAssetAlbum = Index( - 'idx_trashed_local_asset_album', - 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)', - ); - late final Index idxAssetEditAssetId = Index( - 'idx_asset_edit_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_edit_asset_id ON asset_edit_entity (asset_id)', - ); - late final Index idxAssetOcrAssetId = Index( - 'idx_asset_ocr_asset_id', - 'CREATE INDEX IF NOT EXISTS idx_asset_ocr_asset_id ON asset_ocr_entity (asset_id)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAlbumAssetAlbumAsset, - idxLocalAssetChecksum, - idxLocalAssetCloudId, - idxLocalAssetCreatedAt, - idxStackPrimaryAssetId, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - idxRemoteAssetStackId, - idxRemoteAssetOwnerVisibilityDeletedCreated, - idxRemoteAssetUploaded, - authUserEntity, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - remoteAssetCloudIdEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - trashedLocalAssetEntity, - assetEditEntity, - settings, - assetOcrEntity, - idxPartnerSharedWithId, - idxLatLng, - idxRemoteExifCity, - idxRemoteAlbumAssetAlbumAsset, - idxRemoteAssetCloudId, - idxPersonOwnerId, - idxAssetFacePersonId, - idxAssetFaceAssetId, - idxAssetFaceVisiblePerson, - idxTrashedLocalAssetChecksum, - idxTrashedLocalAssetAlbum, - idxAssetEditAssetId, - idxAssetOcrAssetId, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('stack_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('local_album_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'local_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('local_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('user_metadata_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('partner_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('remote_exif_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_asset_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_album_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_album_user_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [ - TableUpdate('remote_asset_cloud_id_entity', kind: UpdateKind.delete), - ], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'memory_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('memory_asset_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'user_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('person_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'person_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_face_entity', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_edit_entity', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'remote_asset_entity', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('asset_ocr_entity', kind: UpdateKind.delete)], - ), - ]); - @override - int get schemaVersion => 31; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v4.dart b/mobile/test/drift/main/generated/schema_v4.dart deleted file mode 100644 index 8321f23a0d..0000000000 --- a/mobile/test/drift/main/generated/schema_v4.dart +++ /dev/null @@ -1,6444 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn profileImagePath = GeneratedColumn( - 'profile_image_path', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn quotaSizeInBytes = GeneratedColumn( - 'quota_size_in_bytes', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn quotaUsageInBytes = GeneratedColumn( - 'quota_usage_in_bytes', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - profileImagePath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}profile_image_path'], - ), - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - quotaSizeInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_size_in_bytes'], - ), - quotaUsageInBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}quota_usage_in_bytes'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final String? profileImagePath; - final DateTime updatedAt; - final int? quotaSizeInBytes; - final int quotaUsageInBytes; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - this.profileImagePath, - required this.updatedAt, - this.quotaSizeInBytes, - required this.quotaUsageInBytes, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - if (!nullToAbsent || profileImagePath != null) { - map['profile_image_path'] = Variable(profileImagePath); - } - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || quotaSizeInBytes != null) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes); - } - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - profileImagePath: serializer.fromJson(json['profileImagePath']), - updatedAt: serializer.fromJson(json['updatedAt']), - quotaSizeInBytes: serializer.fromJson(json['quotaSizeInBytes']), - quotaUsageInBytes: serializer.fromJson(json['quotaUsageInBytes']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'profileImagePath': serializer.toJson(profileImagePath), - 'updatedAt': serializer.toJson(updatedAt), - 'quotaSizeInBytes': serializer.toJson(quotaSizeInBytes), - 'quotaUsageInBytes': serializer.toJson(quotaUsageInBytes), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - Value profileImagePath = const Value.absent(), - DateTime? updatedAt, - Value quotaSizeInBytes = const Value.absent(), - int? quotaUsageInBytes, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath.present - ? profileImagePath.value - : this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes.present - ? quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - profileImagePath: data.profileImagePath.present - ? data.profileImagePath.value - : this.profileImagePath, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - quotaSizeInBytes: data.quotaSizeInBytes.present - ? data.quotaSizeInBytes.value - : this.quotaSizeInBytes, - quotaUsageInBytes: data.quotaUsageInBytes.present - ? data.quotaUsageInBytes.value - : this.quotaUsageInBytes, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - profileImagePath, - updatedAt, - quotaSizeInBytes, - quotaUsageInBytes, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.profileImagePath == this.profileImagePath && - other.updatedAt == this.updatedAt && - other.quotaSizeInBytes == this.quotaSizeInBytes && - other.quotaUsageInBytes == this.quotaUsageInBytes); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value profileImagePath; - final Value updatedAt; - final Value quotaSizeInBytes; - final Value quotaUsageInBytes; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.profileImagePath = const Value.absent(), - this.updatedAt = const Value.absent(), - this.quotaSizeInBytes = const Value.absent(), - this.quotaUsageInBytes = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? profileImagePath, - Expression? updatedAt, - Expression? quotaSizeInBytes, - Expression? quotaUsageInBytes, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (profileImagePath != null) 'profile_image_path': profileImagePath, - if (updatedAt != null) 'updated_at': updatedAt, - if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes, - if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? profileImagePath, - Value? updatedAt, - Value? quotaSizeInBytes, - Value? quotaUsageInBytes, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - profileImagePath: profileImagePath ?? this.profileImagePath, - updatedAt: updatedAt ?? this.updatedAt, - quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes, - quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (profileImagePath.present) { - map['profile_image_path'] = Variable(profileImagePath.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (quotaSizeInBytes.present) { - map['quota_size_in_bytes'] = Variable(quotaSizeInBytes.value); - } - if (quotaUsageInBytes.present) { - map['quota_usage_in_bytes'] = Variable(quotaUsageInBytes.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('profileImagePath: $profileImagePath, ') - ..write('updatedAt: $updatedAt, ') - ..write('quotaSizeInBytes: $quotaSizeInBytes, ') - ..write('quotaUsageInBytes: $quotaUsageInBytes') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV4 extends GeneratedDatabase { - DatabaseAtV4(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index uQRemoteAssetOwnerChecksum = Index( - 'UQ_remote_asset_owner_checksum', - 'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - uQRemoteAssetOwnerChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - ]; - @override - int get schemaVersion => 4; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v5.dart b/mobile/test/drift/main/generated/schema_v5.dart deleted file mode 100644 index e9f276c6bc..0000000000 --- a/mobile/test/drift/main/generated/schema_v5.dart +++ /dev/null @@ -1,6405 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final DateTime updatedAt; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - DateTime? updatedAt, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.updatedAt == this.updatedAt); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value updatedAt; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? updatedAt, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV5 extends GeneratedDatabase { - DatabaseAtV5(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index uQRemoteAssetOwnerChecksum = Index( - 'UQ_remote_asset_owner_checksum', - 'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - uQRemoteAssetOwnerChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - ]; - @override - int get schemaVersion => 5; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v6.dart b/mobile/test/drift/main/generated/schema_v6.dart deleted file mode 100644 index 0a3fe51fb9..0000000000 --- a/mobile/test/drift/main/generated/schema_v6.dart +++ /dev/null @@ -1,6451 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final DateTime updatedAt; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - DateTime? updatedAt, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.updatedAt == this.updatedAt); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value updatedAt; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? updatedAt, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV6 extends GeneratedDatabase { - DatabaseAtV6(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - ]; - @override - int get schemaVersion => 6; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v7.dart b/mobile/test/drift/main/generated/schema_v7.dart deleted file mode 100644 index e08c1ca445..0000000000 --- a/mobile/test/drift/main/generated/schema_v7.dart +++ /dev/null @@ -1,6456 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final DateTime updatedAt; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - DateTime? updatedAt, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.updatedAt == this.updatedAt); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value updatedAt; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? updatedAt, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV7 extends GeneratedDatabase { - DatabaseAtV7(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - idxLatLng, - ]; - @override - int get schemaVersion => 7; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v8.dart b/mobile/test/drift/main/generated/schema_v8.dart deleted file mode 100644 index 55a9d3ef4f..0000000000 --- a/mobile/test/drift/main/generated/schema_v8.dart +++ /dev/null @@ -1,6666 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final DateTime updatedAt; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - DateTime? updatedAt, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.updatedAt == this.updatedAt); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value updatedAt; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? updatedAt, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV8 extends GeneratedDatabase { - DatabaseAtV8(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - idxLatLng, - ]; - @override - int get schemaVersion => 8; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -} diff --git a/mobile/test/drift/main/generated/schema_v9.dart b/mobile/test/drift/main/generated/schema_v9.dart deleted file mode 100644 index f09db1a378..0000000000 --- a/mobile/test/drift/main/generated/schema_v9.dart +++ /dev/null @@ -1,6715 +0,0 @@ -// dart format width=80 -import 'dart:typed_data' as i2; -// GENERATED BY drift_dev, DO NOT MODIFY. -// ignore_for_file: type=lint,unused_import -// -import 'package:drift/drift.dart'; - -class UserEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isAdmin = GeneratedColumn( - 'is_admin', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_admin" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn email = GeneratedColumn( - 'email', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn hasProfileImage = GeneratedColumn( - 'has_profile_image', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("has_profile_image" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn profileChangedAt = - GeneratedColumn( - 'profile_changed_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - @override - List get $columns => [ - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_entity'; - @override - Set get $primaryKey => {id}; - @override - UserEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - isAdmin: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_admin'], - )!, - email: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}email'], - )!, - hasProfileImage: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}has_profile_image'], - )!, - profileChangedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}profile_changed_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - UserEntity createAlias(String alias) { - return UserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserEntityData extends DataClass implements Insertable { - final String id; - final String name; - final bool isAdmin; - final String email; - final bool hasProfileImage; - final DateTime profileChangedAt; - final DateTime updatedAt; - const UserEntityData({ - required this.id, - required this.name, - required this.isAdmin, - required this.email, - required this.hasProfileImage, - required this.profileChangedAt, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['is_admin'] = Variable(isAdmin); - map['email'] = Variable(email); - map['has_profile_image'] = Variable(hasProfileImage); - map['profile_changed_at'] = Variable(profileChangedAt); - map['updated_at'] = Variable(updatedAt); - return map; - } - - factory UserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - isAdmin: serializer.fromJson(json['isAdmin']), - email: serializer.fromJson(json['email']), - hasProfileImage: serializer.fromJson(json['hasProfileImage']), - profileChangedAt: serializer.fromJson(json['profileChangedAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'isAdmin': serializer.toJson(isAdmin), - 'email': serializer.toJson(email), - 'hasProfileImage': serializer.toJson(hasProfileImage), - 'profileChangedAt': serializer.toJson(profileChangedAt), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - UserEntityData copyWith({ - String? id, - String? name, - bool? isAdmin, - String? email, - bool? hasProfileImage, - DateTime? profileChangedAt, - DateTime? updatedAt, - }) => UserEntityData( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - UserEntityData copyWithCompanion(UserEntityCompanion data) { - return UserEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin, - email: data.email.present ? data.email.value : this.email, - hasProfileImage: data.hasProfileImage.present - ? data.hasProfileImage.value - : this.hasProfileImage, - profileChangedAt: data.profileChangedAt.present - ? data.profileChangedAt.value - : this.profileChangedAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('UserEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - isAdmin, - email, - hasProfileImage, - profileChangedAt, - updatedAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserEntityData && - other.id == this.id && - other.name == this.name && - other.isAdmin == this.isAdmin && - other.email == this.email && - other.hasProfileImage == this.hasProfileImage && - other.profileChangedAt == this.profileChangedAt && - other.updatedAt == this.updatedAt); -} - -class UserEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value isAdmin; - final Value email; - final Value hasProfileImage; - final Value profileChangedAt; - final Value updatedAt; - const UserEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.isAdmin = const Value.absent(), - this.email = const Value.absent(), - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }); - UserEntityCompanion.insert({ - required String id, - required String name, - this.isAdmin = const Value.absent(), - required String email, - this.hasProfileImage = const Value.absent(), - this.profileChangedAt = const Value.absent(), - this.updatedAt = const Value.absent(), - }) : id = Value(id), - name = Value(name), - email = Value(email); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? isAdmin, - Expression? email, - Expression? hasProfileImage, - Expression? profileChangedAt, - Expression? updatedAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (isAdmin != null) 'is_admin': isAdmin, - if (email != null) 'email': email, - if (hasProfileImage != null) 'has_profile_image': hasProfileImage, - if (profileChangedAt != null) 'profile_changed_at': profileChangedAt, - if (updatedAt != null) 'updated_at': updatedAt, - }); - } - - UserEntityCompanion copyWith({ - Value? id, - Value? name, - Value? isAdmin, - Value? email, - Value? hasProfileImage, - Value? profileChangedAt, - Value? updatedAt, - }) { - return UserEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - isAdmin: isAdmin ?? this.isAdmin, - email: email ?? this.email, - hasProfileImage: hasProfileImage ?? this.hasProfileImage, - profileChangedAt: profileChangedAt ?? this.profileChangedAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (isAdmin.present) { - map['is_admin'] = Variable(isAdmin.value); - } - if (email.present) { - map['email'] = Variable(email.value); - } - if (hasProfileImage.present) { - map['has_profile_image'] = Variable(hasProfileImage.value); - } - if (profileChangedAt.present) { - map['profile_changed_at'] = Variable(profileChangedAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('isAdmin: $isAdmin, ') - ..write('email: $email, ') - ..write('hasProfileImage: $hasProfileImage, ') - ..write('profileChangedAt: $profileChangedAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } -} - -class RemoteAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn localDateTime = - GeneratedColumn( - 'local_date_time', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn thumbHash = GeneratedColumn( - 'thumb_hash', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn livePhotoVideoId = GeneratedColumn( - 'live_photo_video_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn visibility = GeneratedColumn( - 'visibility', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stackId = GeneratedColumn( - 'stack_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn libraryId = GeneratedColumn( - 'library_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - )!, - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - localDateTime: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}local_date_time'], - ), - thumbHash: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_hash'], - ), - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - livePhotoVideoId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}live_photo_video_id'], - ), - visibility: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}visibility'], - )!, - stackId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}stack_id'], - ), - libraryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}library_id'], - ), - ); - } - - @override - RemoteAssetEntity createAlias(String alias) { - return RemoteAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String checksum; - final bool isFavorite; - final String ownerId; - final DateTime? localDateTime; - final String? thumbHash; - final DateTime? deletedAt; - final String? livePhotoVideoId; - final int visibility; - final String? stackId; - final String? libraryId; - const RemoteAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - required this.checksum, - required this.isFavorite, - required this.ownerId, - this.localDateTime, - this.thumbHash, - this.deletedAt, - this.livePhotoVideoId, - required this.visibility, - this.stackId, - this.libraryId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - map['checksum'] = Variable(checksum); - map['is_favorite'] = Variable(isFavorite); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || localDateTime != null) { - map['local_date_time'] = Variable(localDateTime); - } - if (!nullToAbsent || thumbHash != null) { - map['thumb_hash'] = Variable(thumbHash); - } - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - if (!nullToAbsent || livePhotoVideoId != null) { - map['live_photo_video_id'] = Variable(livePhotoVideoId); - } - map['visibility'] = Variable(visibility); - if (!nullToAbsent || stackId != null) { - map['stack_id'] = Variable(stackId); - } - if (!nullToAbsent || libraryId != null) { - map['library_id'] = Variable(libraryId); - } - return map; - } - - factory RemoteAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - ownerId: serializer.fromJson(json['ownerId']), - localDateTime: serializer.fromJson(json['localDateTime']), - thumbHash: serializer.fromJson(json['thumbHash']), - deletedAt: serializer.fromJson(json['deletedAt']), - livePhotoVideoId: serializer.fromJson(json['livePhotoVideoId']), - visibility: serializer.fromJson(json['visibility']), - stackId: serializer.fromJson(json['stackId']), - libraryId: serializer.fromJson(json['libraryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'ownerId': serializer.toJson(ownerId), - 'localDateTime': serializer.toJson(localDateTime), - 'thumbHash': serializer.toJson(thumbHash), - 'deletedAt': serializer.toJson(deletedAt), - 'livePhotoVideoId': serializer.toJson(livePhotoVideoId), - 'visibility': serializer.toJson(visibility), - 'stackId': serializer.toJson(stackId), - 'libraryId': serializer.toJson(libraryId), - }; - } - - RemoteAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - String? checksum, - bool? isFavorite, - String? ownerId, - Value localDateTime = const Value.absent(), - Value thumbHash = const Value.absent(), - Value deletedAt = const Value.absent(), - Value livePhotoVideoId = const Value.absent(), - int? visibility, - Value stackId = const Value.absent(), - Value libraryId = const Value.absent(), - }) => RemoteAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime.present - ? localDateTime.value - : this.localDateTime, - thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - livePhotoVideoId: livePhotoVideoId.present - ? livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId.present ? stackId.value : this.stackId, - libraryId: libraryId.present ? libraryId.value : this.libraryId, - ); - RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) { - return RemoteAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - localDateTime: data.localDateTime.present - ? data.localDateTime.value - : this.localDateTime, - thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - livePhotoVideoId: data.livePhotoVideoId.present - ? data.livePhotoVideoId.value - : this.livePhotoVideoId, - visibility: data.visibility.present - ? data.visibility.value - : this.visibility, - stackId: data.stackId.present ? data.stackId.value : this.stackId, - libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - ownerId, - localDateTime, - thumbHash, - deletedAt, - livePhotoVideoId, - visibility, - stackId, - libraryId, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.ownerId == this.ownerId && - other.localDateTime == this.localDateTime && - other.thumbHash == this.thumbHash && - other.deletedAt == this.deletedAt && - other.livePhotoVideoId == this.livePhotoVideoId && - other.visibility == this.visibility && - other.stackId == this.stackId && - other.libraryId == this.libraryId); -} - -class RemoteAssetEntityCompanion - extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value ownerId; - final Value localDateTime; - final Value thumbHash; - final Value deletedAt; - final Value livePhotoVideoId; - final Value visibility; - final Value stackId; - final Value libraryId; - const RemoteAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.ownerId = const Value.absent(), - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - this.visibility = const Value.absent(), - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }); - RemoteAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - required String checksum, - this.isFavorite = const Value.absent(), - required String ownerId, - this.localDateTime = const Value.absent(), - this.thumbHash = const Value.absent(), - this.deletedAt = const Value.absent(), - this.livePhotoVideoId = const Value.absent(), - required int visibility, - this.stackId = const Value.absent(), - this.libraryId = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id), - checksum = Value(checksum), - ownerId = Value(ownerId), - visibility = Value(visibility); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? ownerId, - Expression? localDateTime, - Expression? thumbHash, - Expression? deletedAt, - Expression? livePhotoVideoId, - Expression? visibility, - Expression? stackId, - Expression? libraryId, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (ownerId != null) 'owner_id': ownerId, - if (localDateTime != null) 'local_date_time': localDateTime, - if (thumbHash != null) 'thumb_hash': thumbHash, - if (deletedAt != null) 'deleted_at': deletedAt, - if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId, - if (visibility != null) 'visibility': visibility, - if (stackId != null) 'stack_id': stackId, - if (libraryId != null) 'library_id': libraryId, - }); - } - - RemoteAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? ownerId, - Value? localDateTime, - Value? thumbHash, - Value? deletedAt, - Value? livePhotoVideoId, - Value? visibility, - Value? stackId, - Value? libraryId, - }) { - return RemoteAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - ownerId: ownerId ?? this.ownerId, - localDateTime: localDateTime ?? this.localDateTime, - thumbHash: thumbHash ?? this.thumbHash, - deletedAt: deletedAt ?? this.deletedAt, - livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId, - visibility: visibility ?? this.visibility, - stackId: stackId ?? this.stackId, - libraryId: libraryId ?? this.libraryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (localDateTime.present) { - map['local_date_time'] = Variable(localDateTime.value); - } - if (thumbHash.present) { - map['thumb_hash'] = Variable(thumbHash.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (livePhotoVideoId.present) { - map['live_photo_video_id'] = Variable(livePhotoVideoId.value); - } - if (visibility.present) { - map['visibility'] = Variable(visibility.value); - } - if (stackId.present) { - map['stack_id'] = Variable(stackId.value); - } - if (libraryId.present) { - map['library_id'] = Variable(libraryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('ownerId: $ownerId, ') - ..write('localDateTime: $localDateTime, ') - ..write('thumbHash: $thumbHash, ') - ..write('deletedAt: $deletedAt, ') - ..write('livePhotoVideoId: $livePhotoVideoId, ') - ..write('visibility: $visibility, ') - ..write('stackId: $stackId, ') - ..write('libraryId: $libraryId') - ..write(')')) - .toString(); - } -} - -class StackEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StackEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn primaryAssetId = GeneratedColumn( - 'primary_asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - primaryAssetId, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'stack_entity'; - @override - Set get $primaryKey => {id}; - @override - StackEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StackEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - primaryAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}primary_asset_id'], - )!, - ); - } - - @override - StackEntity createAlias(String alias) { - return StackEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StackEntityData extends DataClass implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String primaryAssetId; - const StackEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.primaryAssetId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['primary_asset_id'] = Variable(primaryAssetId); - return map; - } - - factory StackEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StackEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - primaryAssetId: serializer.fromJson(json['primaryAssetId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'primaryAssetId': serializer.toJson(primaryAssetId), - }; - } - - StackEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? primaryAssetId, - }) => StackEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - StackEntityData copyWithCompanion(StackEntityCompanion data) { - return StackEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - primaryAssetId: data.primaryAssetId.present - ? data.primaryAssetId.value - : this.primaryAssetId, - ); - } - - @override - String toString() { - return (StringBuffer('StackEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StackEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.primaryAssetId == this.primaryAssetId); -} - -class StackEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value primaryAssetId; - const StackEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.primaryAssetId = const Value.absent(), - }); - StackEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String primaryAssetId, - }) : id = Value(id), - ownerId = Value(ownerId), - primaryAssetId = Value(primaryAssetId); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? primaryAssetId, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (primaryAssetId != null) 'primary_asset_id': primaryAssetId, - }); - } - - StackEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? primaryAssetId, - }) { - return StackEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - primaryAssetId: primaryAssetId ?? this.primaryAssetId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (primaryAssetId.present) { - map['primary_asset_id'] = Variable(primaryAssetId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StackEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('primaryAssetId: $primaryAssetId') - ..write(')')) - .toString(); - } -} - -class LocalAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn durationInSeconds = GeneratedColumn( - 'duration_in_seconds', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn checksum = GeneratedColumn( - 'checksum', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [ - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_asset_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAssetEntityData( - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - durationInSeconds: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration_in_seconds'], - ), - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - checksum: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}checksum'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}orientation'], - )!, - ); - } - - @override - LocalAssetEntity createAlias(String alias) { - return LocalAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAssetEntityData extends DataClass - implements Insertable { - final String name; - final int type; - final DateTime createdAt; - final DateTime updatedAt; - final int? width; - final int? height; - final int? durationInSeconds; - final String id; - final String? checksum; - final bool isFavorite; - final int orientation; - const LocalAssetEntityData({ - required this.name, - required this.type, - required this.createdAt, - required this.updatedAt, - this.width, - this.height, - this.durationInSeconds, - required this.id, - this.checksum, - required this.isFavorite, - required this.orientation, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['name'] = Variable(name); - map['type'] = Variable(type); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || durationInSeconds != null) { - map['duration_in_seconds'] = Variable(durationInSeconds); - } - map['id'] = Variable(id); - if (!nullToAbsent || checksum != null) { - map['checksum'] = Variable(checksum); - } - map['is_favorite'] = Variable(isFavorite); - map['orientation'] = Variable(orientation); - return map; - } - - factory LocalAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAssetEntityData( - name: serializer.fromJson(json['name']), - type: serializer.fromJson(json['type']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - width: serializer.fromJson(json['width']), - height: serializer.fromJson(json['height']), - durationInSeconds: serializer.fromJson(json['durationInSeconds']), - id: serializer.fromJson(json['id']), - checksum: serializer.fromJson(json['checksum']), - isFavorite: serializer.fromJson(json['isFavorite']), - orientation: serializer.fromJson(json['orientation']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'name': serializer.toJson(name), - 'type': serializer.toJson(type), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'width': serializer.toJson(width), - 'height': serializer.toJson(height), - 'durationInSeconds': serializer.toJson(durationInSeconds), - 'id': serializer.toJson(id), - 'checksum': serializer.toJson(checksum), - 'isFavorite': serializer.toJson(isFavorite), - 'orientation': serializer.toJson(orientation), - }; - } - - LocalAssetEntityData copyWith({ - String? name, - int? type, - DateTime? createdAt, - DateTime? updatedAt, - Value width = const Value.absent(), - Value height = const Value.absent(), - Value durationInSeconds = const Value.absent(), - String? id, - Value checksum = const Value.absent(), - bool? isFavorite, - int? orientation, - }) => LocalAssetEntityData( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width.present ? width.value : this.width, - height: height.present ? height.value : this.height, - durationInSeconds: durationInSeconds.present - ? durationInSeconds.value - : this.durationInSeconds, - id: id ?? this.id, - checksum: checksum.present ? checksum.value : this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) { - return LocalAssetEntityData( - name: data.name.present ? data.name.value : this.name, - type: data.type.present ? data.type.value : this.type, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - width: data.width.present ? data.width.value : this.width, - height: data.height.present ? data.height.value : this.height, - durationInSeconds: data.durationInSeconds.present - ? data.durationInSeconds.value - : this.durationInSeconds, - id: data.id.present ? data.id.value : this.id, - checksum: data.checksum.present ? data.checksum.value : this.checksum, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityData(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - name, - type, - createdAt, - updatedAt, - width, - height, - durationInSeconds, - id, - checksum, - isFavorite, - orientation, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAssetEntityData && - other.name == this.name && - other.type == this.type && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.width == this.width && - other.height == this.height && - other.durationInSeconds == this.durationInSeconds && - other.id == this.id && - other.checksum == this.checksum && - other.isFavorite == this.isFavorite && - other.orientation == this.orientation); -} - -class LocalAssetEntityCompanion extends UpdateCompanion { - final Value name; - final Value type; - final Value createdAt; - final Value updatedAt; - final Value width; - final Value height; - final Value durationInSeconds; - final Value id; - final Value checksum; - final Value isFavorite; - final Value orientation; - const LocalAssetEntityCompanion({ - this.name = const Value.absent(), - this.type = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - this.id = const Value.absent(), - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }); - LocalAssetEntityCompanion.insert({ - required String name, - required int type, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.width = const Value.absent(), - this.height = const Value.absent(), - this.durationInSeconds = const Value.absent(), - required String id, - this.checksum = const Value.absent(), - this.isFavorite = const Value.absent(), - this.orientation = const Value.absent(), - }) : name = Value(name), - type = Value(type), - id = Value(id); - static Insertable custom({ - Expression? name, - Expression? type, - Expression? createdAt, - Expression? updatedAt, - Expression? width, - Expression? height, - Expression? durationInSeconds, - Expression? id, - Expression? checksum, - Expression? isFavorite, - Expression? orientation, - }) { - return RawValuesInsertable({ - if (name != null) 'name': name, - if (type != null) 'type': type, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (width != null) 'width': width, - if (height != null) 'height': height, - if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds, - if (id != null) 'id': id, - if (checksum != null) 'checksum': checksum, - if (isFavorite != null) 'is_favorite': isFavorite, - if (orientation != null) 'orientation': orientation, - }); - } - - LocalAssetEntityCompanion copyWith({ - Value? name, - Value? type, - Value? createdAt, - Value? updatedAt, - Value? width, - Value? height, - Value? durationInSeconds, - Value? id, - Value? checksum, - Value? isFavorite, - Value? orientation, - }) { - return LocalAssetEntityCompanion( - name: name ?? this.name, - type: type ?? this.type, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - width: width ?? this.width, - height: height ?? this.height, - durationInSeconds: durationInSeconds ?? this.durationInSeconds, - id: id ?? this.id, - checksum: checksum ?? this.checksum, - isFavorite: isFavorite ?? this.isFavorite, - orientation: orientation ?? this.orientation, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (name.present) { - map['name'] = Variable(name.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (durationInSeconds.present) { - map['duration_in_seconds'] = Variable(durationInSeconds.value); - } - if (id.present) { - map['id'] = Variable(id.value); - } - if (checksum.present) { - map['checksum'] = Variable(checksum.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAssetEntityCompanion(') - ..write('name: $name, ') - ..write('type: $type, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('width: $width, ') - ..write('height: $height, ') - ..write('durationInSeconds: $durationInSeconds, ') - ..write('id: $id, ') - ..write('checksum: $checksum, ') - ..write('isFavorite: $isFavorite, ') - ..write('orientation: $orientation') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultValue: const CustomExpression('\'\''), - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn thumbnailAssetId = GeneratedColumn( - 'thumbnail_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn isActivityEnabled = GeneratedColumn( - 'is_activity_enabled', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_activity_enabled" IN (0, 1))', - ), - defaultValue: const CustomExpression('1'), - ); - late final GeneratedColumn order = GeneratedColumn( - 'order', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_entity'; - @override - Set get $primaryKey => {id}; - @override - RemoteAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - thumbnailAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumbnail_asset_id'], - ), - isActivityEnabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_activity_enabled'], - )!, - order: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}order'], - )!, - ); - } - - @override - RemoteAlbumEntity createAlias(String alias) { - return RemoteAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final String description; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String? thumbnailAssetId; - final bool isActivityEnabled; - final int order; - const RemoteAlbumEntityData({ - required this.id, - required this.name, - required this.description, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - this.thumbnailAssetId, - required this.isActivityEnabled, - required this.order, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['description'] = Variable(description); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - if (!nullToAbsent || thumbnailAssetId != null) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId); - } - map['is_activity_enabled'] = Variable(isActivityEnabled); - map['order'] = Variable(order); - return map; - } - - factory RemoteAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - thumbnailAssetId: serializer.fromJson(json['thumbnailAssetId']), - isActivityEnabled: serializer.fromJson(json['isActivityEnabled']), - order: serializer.fromJson(json['order']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'thumbnailAssetId': serializer.toJson(thumbnailAssetId), - 'isActivityEnabled': serializer.toJson(isActivityEnabled), - 'order': serializer.toJson(order), - }; - } - - RemoteAlbumEntityData copyWith({ - String? id, - String? name, - String? description, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - Value thumbnailAssetId = const Value.absent(), - bool? isActivityEnabled, - int? order, - }) => RemoteAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId.present - ? thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) { - return RemoteAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - thumbnailAssetId: data.thumbnailAssetId.present - ? data.thumbnailAssetId.value - : this.thumbnailAssetId, - isActivityEnabled: data.isActivityEnabled.present - ? data.isActivityEnabled.value - : this.isActivityEnabled, - order: data.order.present ? data.order.value : this.order, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - description, - createdAt, - updatedAt, - ownerId, - thumbnailAssetId, - isActivityEnabled, - order, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.description == this.description && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.thumbnailAssetId == this.thumbnailAssetId && - other.isActivityEnabled == this.isActivityEnabled && - other.order == this.order); -} - -class RemoteAlbumEntityCompanion - extends UpdateCompanion { - final Value id; - final Value name; - final Value description; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value thumbnailAssetId; - final Value isActivityEnabled; - final Value order; - const RemoteAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - this.order = const Value.absent(), - }); - RemoteAlbumEntityCompanion.insert({ - required String id, - required String name, - this.description = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - this.thumbnailAssetId = const Value.absent(), - this.isActivityEnabled = const Value.absent(), - required int order, - }) : id = Value(id), - name = Value(name), - ownerId = Value(ownerId), - order = Value(order); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? description, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? thumbnailAssetId, - Expression? isActivityEnabled, - Expression? order, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId, - if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled, - if (order != null) 'order': order, - }); - } - - RemoteAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? description, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? thumbnailAssetId, - Value? isActivityEnabled, - Value? order, - }) { - return RemoteAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - description: description ?? this.description, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId, - isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled, - order: order ?? this.order, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (thumbnailAssetId.present) { - map['thumbnail_asset_id'] = Variable(thumbnailAssetId.value); - } - if (isActivityEnabled.present) { - map['is_activity_enabled'] = Variable(isActivityEnabled.value); - } - if (order.present) { - map['order'] = Variable(order.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('thumbnailAssetId: $thumbnailAssetId, ') - ..write('isActivityEnabled: $isActivityEnabled, ') - ..write('order: $order') - ..write(')')) - .toString(); - } -} - -class LocalAlbumEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn backupSelection = GeneratedColumn( - 'backup_selection', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn isIosSharedAlbum = GeneratedColumn( - 'is_ios_shared_album', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_ios_shared_album" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn linkedRemoteAlbumId = - GeneratedColumn( - 'linked_remote_album_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn marker_ = GeneratedColumn( - 'marker', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("marker" IN (0, 1))', - ), - ); - @override - List get $columns => [ - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_entity'; - @override - Set get $primaryKey => {id}; - @override - LocalAlbumEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - backupSelection: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}backup_selection'], - )!, - isIosSharedAlbum: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_ios_shared_album'], - )!, - linkedRemoteAlbumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}linked_remote_album_id'], - ), - marker_: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}marker'], - ), - ); - } - - @override - LocalAlbumEntity createAlias(String alias) { - return LocalAlbumEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumEntityData extends DataClass - implements Insertable { - final String id; - final String name; - final DateTime updatedAt; - final int backupSelection; - final bool isIosSharedAlbum; - final String? linkedRemoteAlbumId; - final bool? marker_; - const LocalAlbumEntityData({ - required this.id, - required this.name, - required this.updatedAt, - required this.backupSelection, - required this.isIosSharedAlbum, - this.linkedRemoteAlbumId, - this.marker_, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['updated_at'] = Variable(updatedAt); - map['backup_selection'] = Variable(backupSelection); - map['is_ios_shared_album'] = Variable(isIosSharedAlbum); - if (!nullToAbsent || linkedRemoteAlbumId != null) { - map['linked_remote_album_id'] = Variable(linkedRemoteAlbumId); - } - if (!nullToAbsent || marker_ != null) { - map['marker'] = Variable(marker_); - } - return map; - } - - factory LocalAlbumEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumEntityData( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - updatedAt: serializer.fromJson(json['updatedAt']), - backupSelection: serializer.fromJson(json['backupSelection']), - isIosSharedAlbum: serializer.fromJson(json['isIosSharedAlbum']), - linkedRemoteAlbumId: serializer.fromJson( - json['linkedRemoteAlbumId'], - ), - marker_: serializer.fromJson(json['marker_']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'updatedAt': serializer.toJson(updatedAt), - 'backupSelection': serializer.toJson(backupSelection), - 'isIosSharedAlbum': serializer.toJson(isIosSharedAlbum), - 'linkedRemoteAlbumId': serializer.toJson(linkedRemoteAlbumId), - 'marker_': serializer.toJson(marker_), - }; - } - - LocalAlbumEntityData copyWith({ - String? id, - String? name, - DateTime? updatedAt, - int? backupSelection, - bool? isIosSharedAlbum, - Value linkedRemoteAlbumId = const Value.absent(), - Value marker_ = const Value.absent(), - }) => LocalAlbumEntityData( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId.present - ? linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: marker_.present ? marker_.value : this.marker_, - ); - LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) { - return LocalAlbumEntityData( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - backupSelection: data.backupSelection.present - ? data.backupSelection.value - : this.backupSelection, - isIosSharedAlbum: data.isIosSharedAlbum.present - ? data.isIosSharedAlbum.value - : this.isIosSharedAlbum, - linkedRemoteAlbumId: data.linkedRemoteAlbumId.present - ? data.linkedRemoteAlbumId.value - : this.linkedRemoteAlbumId, - marker_: data.marker_.present ? data.marker_.value : this.marker_, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityData(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - name, - updatedAt, - backupSelection, - isIosSharedAlbum, - linkedRemoteAlbumId, - marker_, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumEntityData && - other.id == this.id && - other.name == this.name && - other.updatedAt == this.updatedAt && - other.backupSelection == this.backupSelection && - other.isIosSharedAlbum == this.isIosSharedAlbum && - other.linkedRemoteAlbumId == this.linkedRemoteAlbumId && - other.marker_ == this.marker_); -} - -class LocalAlbumEntityCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value updatedAt; - final Value backupSelection; - final Value isIosSharedAlbum; - final Value linkedRemoteAlbumId; - final Value marker_; - const LocalAlbumEntityCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.updatedAt = const Value.absent(), - this.backupSelection = const Value.absent(), - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }); - LocalAlbumEntityCompanion.insert({ - required String id, - required String name, - this.updatedAt = const Value.absent(), - required int backupSelection, - this.isIosSharedAlbum = const Value.absent(), - this.linkedRemoteAlbumId = const Value.absent(), - this.marker_ = const Value.absent(), - }) : id = Value(id), - name = Value(name), - backupSelection = Value(backupSelection); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? updatedAt, - Expression? backupSelection, - Expression? isIosSharedAlbum, - Expression? linkedRemoteAlbumId, - Expression? marker_, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (updatedAt != null) 'updated_at': updatedAt, - if (backupSelection != null) 'backup_selection': backupSelection, - if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum, - if (linkedRemoteAlbumId != null) - 'linked_remote_album_id': linkedRemoteAlbumId, - if (marker_ != null) 'marker': marker_, - }); - } - - LocalAlbumEntityCompanion copyWith({ - Value? id, - Value? name, - Value? updatedAt, - Value? backupSelection, - Value? isIosSharedAlbum, - Value? linkedRemoteAlbumId, - Value? marker_, - }) { - return LocalAlbumEntityCompanion( - id: id ?? this.id, - name: name ?? this.name, - updatedAt: updatedAt ?? this.updatedAt, - backupSelection: backupSelection ?? this.backupSelection, - isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum, - linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId, - marker_: marker_ ?? this.marker_, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (backupSelection.present) { - map['backup_selection'] = Variable(backupSelection.value); - } - if (isIosSharedAlbum.present) { - map['is_ios_shared_album'] = Variable(isIosSharedAlbum.value); - } - if (linkedRemoteAlbumId.present) { - map['linked_remote_album_id'] = Variable( - linkedRemoteAlbumId.value, - ); - } - if (marker_.present) { - map['marker'] = Variable(marker_.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumEntityCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('updatedAt: $updatedAt, ') - ..write('backupSelection: $backupSelection, ') - ..write('isIosSharedAlbum: $isIosSharedAlbum, ') - ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ') - ..write('marker_: $marker_') - ..write(')')) - .toString(); - } -} - -class LocalAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES local_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'local_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - LocalAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return LocalAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - LocalAlbumAssetEntity createAlias(String alias) { - return LocalAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class LocalAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const LocalAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory LocalAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return LocalAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - LocalAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - LocalAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - LocalAlbumAssetEntityData copyWithCompanion( - LocalAlbumAssetEntityCompanion data, - ) { - return LocalAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is LocalAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class LocalAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const LocalAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - LocalAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - LocalAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return LocalAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('LocalAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class UserMetadataEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - UserMetadataEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn value = - GeneratedColumn( - 'value', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - ); - @override - List get $columns => [userId, key, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'user_metadata_entity'; - @override - Set get $primaryKey => {userId, key}; - @override - UserMetadataEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return UserMetadataEntityData( - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - key: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}key'], - )!, - value: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}value'], - )!, - ); - } - - @override - UserMetadataEntity createAlias(String alias) { - return UserMetadataEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class UserMetadataEntityData extends DataClass - implements Insertable { - final String userId; - final int key; - final i2.Uint8List value; - const UserMetadataEntityData({ - required this.userId, - required this.key, - required this.value, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['user_id'] = Variable(userId); - map['key'] = Variable(key); - map['value'] = Variable(value); - return map; - } - - factory UserMetadataEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return UserMetadataEntityData( - userId: serializer.fromJson(json['userId']), - key: serializer.fromJson(json['key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'userId': serializer.toJson(userId), - 'key': serializer.toJson(key), - 'value': serializer.toJson(value), - }; - } - - UserMetadataEntityData copyWith({ - String? userId, - int? key, - i2.Uint8List? value, - }) => UserMetadataEntityData( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) { - return UserMetadataEntityData( - userId: data.userId.present ? data.userId.value : this.userId, - key: data.key.present ? data.key.value : this.key, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityData(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value)); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is UserMetadataEntityData && - other.userId == this.userId && - other.key == this.key && - $driftBlobEquality.equals(other.value, this.value)); -} - -class UserMetadataEntityCompanion - extends UpdateCompanion { - final Value userId; - final Value key; - final Value value; - const UserMetadataEntityCompanion({ - this.userId = const Value.absent(), - this.key = const Value.absent(), - this.value = const Value.absent(), - }); - UserMetadataEntityCompanion.insert({ - required String userId, - required int key, - required i2.Uint8List value, - }) : userId = Value(userId), - key = Value(key), - value = Value(value); - static Insertable custom({ - Expression? userId, - Expression? key, - Expression? value, - }) { - return RawValuesInsertable({ - if (userId != null) 'user_id': userId, - if (key != null) 'key': key, - if (value != null) 'value': value, - }); - } - - UserMetadataEntityCompanion copyWith({ - Value? userId, - Value? key, - Value? value, - }) { - return UserMetadataEntityCompanion( - userId: userId ?? this.userId, - key: key ?? this.key, - value: value ?? this.value, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (key.present) { - map['key'] = Variable(key.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('UserMetadataEntityCompanion(') - ..write('userId: $userId, ') - ..write('key: $key, ') - ..write('value: $value') - ..write(')')) - .toString(); - } -} - -class PartnerEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PartnerEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn sharedById = GeneratedColumn( - 'shared_by_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn sharedWithId = GeneratedColumn( - 'shared_with_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn inTimeline = GeneratedColumn( - 'in_timeline', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("in_timeline" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - @override - List get $columns => [sharedById, sharedWithId, inTimeline]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'partner_entity'; - @override - Set get $primaryKey => {sharedById, sharedWithId}; - @override - PartnerEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PartnerEntityData( - sharedById: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_by_id'], - )!, - sharedWithId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}shared_with_id'], - )!, - inTimeline: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}in_timeline'], - )!, - ); - } - - @override - PartnerEntity createAlias(String alias) { - return PartnerEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PartnerEntityData extends DataClass - implements Insertable { - final String sharedById; - final String sharedWithId; - final bool inTimeline; - const PartnerEntityData({ - required this.sharedById, - required this.sharedWithId, - required this.inTimeline, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['shared_by_id'] = Variable(sharedById); - map['shared_with_id'] = Variable(sharedWithId); - map['in_timeline'] = Variable(inTimeline); - return map; - } - - factory PartnerEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PartnerEntityData( - sharedById: serializer.fromJson(json['sharedById']), - sharedWithId: serializer.fromJson(json['sharedWithId']), - inTimeline: serializer.fromJson(json['inTimeline']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'sharedById': serializer.toJson(sharedById), - 'sharedWithId': serializer.toJson(sharedWithId), - 'inTimeline': serializer.toJson(inTimeline), - }; - } - - PartnerEntityData copyWith({ - String? sharedById, - String? sharedWithId, - bool? inTimeline, - }) => PartnerEntityData( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) { - return PartnerEntityData( - sharedById: data.sharedById.present - ? data.sharedById.value - : this.sharedById, - sharedWithId: data.sharedWithId.present - ? data.sharedWithId.value - : this.sharedWithId, - inTimeline: data.inTimeline.present - ? data.inTimeline.value - : this.inTimeline, - ); - } - - @override - String toString() { - return (StringBuffer('PartnerEntityData(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PartnerEntityData && - other.sharedById == this.sharedById && - other.sharedWithId == this.sharedWithId && - other.inTimeline == this.inTimeline); -} - -class PartnerEntityCompanion extends UpdateCompanion { - final Value sharedById; - final Value sharedWithId; - final Value inTimeline; - const PartnerEntityCompanion({ - this.sharedById = const Value.absent(), - this.sharedWithId = const Value.absent(), - this.inTimeline = const Value.absent(), - }); - PartnerEntityCompanion.insert({ - required String sharedById, - required String sharedWithId, - this.inTimeline = const Value.absent(), - }) : sharedById = Value(sharedById), - sharedWithId = Value(sharedWithId); - static Insertable custom({ - Expression? sharedById, - Expression? sharedWithId, - Expression? inTimeline, - }) { - return RawValuesInsertable({ - if (sharedById != null) 'shared_by_id': sharedById, - if (sharedWithId != null) 'shared_with_id': sharedWithId, - if (inTimeline != null) 'in_timeline': inTimeline, - }); - } - - PartnerEntityCompanion copyWith({ - Value? sharedById, - Value? sharedWithId, - Value? inTimeline, - }) { - return PartnerEntityCompanion( - sharedById: sharedById ?? this.sharedById, - sharedWithId: sharedWithId ?? this.sharedWithId, - inTimeline: inTimeline ?? this.inTimeline, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (sharedById.present) { - map['shared_by_id'] = Variable(sharedById.value); - } - if (sharedWithId.present) { - map['shared_with_id'] = Variable(sharedWithId.value); - } - if (inTimeline.present) { - map['in_timeline'] = Variable(inTimeline.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PartnerEntityCompanion(') - ..write('sharedById: $sharedById, ') - ..write('sharedWithId: $sharedWithId, ') - ..write('inTimeline: $inTimeline') - ..write(')')) - .toString(); - } -} - -class RemoteExifEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteExifEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn city = GeneratedColumn( - 'city', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn state = GeneratedColumn( - 'state', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn country = GeneratedColumn( - 'country', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn dateTimeOriginal = - GeneratedColumn( - 'date_time_original', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn height = GeneratedColumn( - 'height', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn width = GeneratedColumn( - 'width', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn exposureTime = GeneratedColumn( - 'exposure_time', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn fNumber = GeneratedColumn( - 'f_number', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn fileSize = GeneratedColumn( - 'file_size', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn focalLength = GeneratedColumn( - 'focal_length', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn latitude = GeneratedColumn( - 'latitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn longitude = GeneratedColumn( - 'longitude', - aliasedName, - true, - type: DriftSqlType.double, - requiredDuringInsert: false, - ); - late final GeneratedColumn iso = GeneratedColumn( - 'iso', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn make = GeneratedColumn( - 'make', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn model = GeneratedColumn( - 'model', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn lens = GeneratedColumn( - 'lens', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn orientation = GeneratedColumn( - 'orientation', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn timeZone = GeneratedColumn( - 'time_zone', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn rating = GeneratedColumn( - 'rating', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - late final GeneratedColumn projectionType = GeneratedColumn( - 'projection_type', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_exif_entity'; - @override - Set get $primaryKey => {assetId}; - @override - RemoteExifEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteExifEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - city: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}city'], - ), - state: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}state'], - ), - country: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}country'], - ), - dateTimeOriginal: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}date_time_original'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - height: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}height'], - ), - width: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}width'], - ), - exposureTime: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}exposure_time'], - ), - fNumber: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}f_number'], - ), - fileSize: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}file_size'], - ), - focalLength: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}focal_length'], - ), - latitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}latitude'], - ), - longitude: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}longitude'], - ), - iso: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}iso'], - ), - make: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}make'], - ), - model: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}model'], - ), - lens: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}lens'], - ), - orientation: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}orientation'], - ), - timeZone: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}time_zone'], - ), - rating: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}rating'], - ), - projectionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}projection_type'], - ), - ); - } - - @override - RemoteExifEntity createAlias(String alias) { - return RemoteExifEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteExifEntityData extends DataClass - implements Insertable { - final String assetId; - final String? city; - final String? state; - final String? country; - final DateTime? dateTimeOriginal; - final String? description; - final int? height; - final int? width; - final String? exposureTime; - final double? fNumber; - final int? fileSize; - final double? focalLength; - final double? latitude; - final double? longitude; - final int? iso; - final String? make; - final String? model; - final String? lens; - final String? orientation; - final String? timeZone; - final int? rating; - final String? projectionType; - const RemoteExifEntityData({ - required this.assetId, - this.city, - this.state, - this.country, - this.dateTimeOriginal, - this.description, - this.height, - this.width, - this.exposureTime, - this.fNumber, - this.fileSize, - this.focalLength, - this.latitude, - this.longitude, - this.iso, - this.make, - this.model, - this.lens, - this.orientation, - this.timeZone, - this.rating, - this.projectionType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || city != null) { - map['city'] = Variable(city); - } - if (!nullToAbsent || state != null) { - map['state'] = Variable(state); - } - if (!nullToAbsent || country != null) { - map['country'] = Variable(country); - } - if (!nullToAbsent || dateTimeOriginal != null) { - map['date_time_original'] = Variable(dateTimeOriginal); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || height != null) { - map['height'] = Variable(height); - } - if (!nullToAbsent || width != null) { - map['width'] = Variable(width); - } - if (!nullToAbsent || exposureTime != null) { - map['exposure_time'] = Variable(exposureTime); - } - if (!nullToAbsent || fNumber != null) { - map['f_number'] = Variable(fNumber); - } - if (!nullToAbsent || fileSize != null) { - map['file_size'] = Variable(fileSize); - } - if (!nullToAbsent || focalLength != null) { - map['focal_length'] = Variable(focalLength); - } - if (!nullToAbsent || latitude != null) { - map['latitude'] = Variable(latitude); - } - if (!nullToAbsent || longitude != null) { - map['longitude'] = Variable(longitude); - } - if (!nullToAbsent || iso != null) { - map['iso'] = Variable(iso); - } - if (!nullToAbsent || make != null) { - map['make'] = Variable(make); - } - if (!nullToAbsent || model != null) { - map['model'] = Variable(model); - } - if (!nullToAbsent || lens != null) { - map['lens'] = Variable(lens); - } - if (!nullToAbsent || orientation != null) { - map['orientation'] = Variable(orientation); - } - if (!nullToAbsent || timeZone != null) { - map['time_zone'] = Variable(timeZone); - } - if (!nullToAbsent || rating != null) { - map['rating'] = Variable(rating); - } - if (!nullToAbsent || projectionType != null) { - map['projection_type'] = Variable(projectionType); - } - return map; - } - - factory RemoteExifEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteExifEntityData( - assetId: serializer.fromJson(json['assetId']), - city: serializer.fromJson(json['city']), - state: serializer.fromJson(json['state']), - country: serializer.fromJson(json['country']), - dateTimeOriginal: serializer.fromJson( - json['dateTimeOriginal'], - ), - description: serializer.fromJson(json['description']), - height: serializer.fromJson(json['height']), - width: serializer.fromJson(json['width']), - exposureTime: serializer.fromJson(json['exposureTime']), - fNumber: serializer.fromJson(json['fNumber']), - fileSize: serializer.fromJson(json['fileSize']), - focalLength: serializer.fromJson(json['focalLength']), - latitude: serializer.fromJson(json['latitude']), - longitude: serializer.fromJson(json['longitude']), - iso: serializer.fromJson(json['iso']), - make: serializer.fromJson(json['make']), - model: serializer.fromJson(json['model']), - lens: serializer.fromJson(json['lens']), - orientation: serializer.fromJson(json['orientation']), - timeZone: serializer.fromJson(json['timeZone']), - rating: serializer.fromJson(json['rating']), - projectionType: serializer.fromJson(json['projectionType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'city': serializer.toJson(city), - 'state': serializer.toJson(state), - 'country': serializer.toJson(country), - 'dateTimeOriginal': serializer.toJson(dateTimeOriginal), - 'description': serializer.toJson(description), - 'height': serializer.toJson(height), - 'width': serializer.toJson(width), - 'exposureTime': serializer.toJson(exposureTime), - 'fNumber': serializer.toJson(fNumber), - 'fileSize': serializer.toJson(fileSize), - 'focalLength': serializer.toJson(focalLength), - 'latitude': serializer.toJson(latitude), - 'longitude': serializer.toJson(longitude), - 'iso': serializer.toJson(iso), - 'make': serializer.toJson(make), - 'model': serializer.toJson(model), - 'lens': serializer.toJson(lens), - 'orientation': serializer.toJson(orientation), - 'timeZone': serializer.toJson(timeZone), - 'rating': serializer.toJson(rating), - 'projectionType': serializer.toJson(projectionType), - }; - } - - RemoteExifEntityData copyWith({ - String? assetId, - Value city = const Value.absent(), - Value state = const Value.absent(), - Value country = const Value.absent(), - Value dateTimeOriginal = const Value.absent(), - Value description = const Value.absent(), - Value height = const Value.absent(), - Value width = const Value.absent(), - Value exposureTime = const Value.absent(), - Value fNumber = const Value.absent(), - Value fileSize = const Value.absent(), - Value focalLength = const Value.absent(), - Value latitude = const Value.absent(), - Value longitude = const Value.absent(), - Value iso = const Value.absent(), - Value make = const Value.absent(), - Value model = const Value.absent(), - Value lens = const Value.absent(), - Value orientation = const Value.absent(), - Value timeZone = const Value.absent(), - Value rating = const Value.absent(), - Value projectionType = const Value.absent(), - }) => RemoteExifEntityData( - assetId: assetId ?? this.assetId, - city: city.present ? city.value : this.city, - state: state.present ? state.value : this.state, - country: country.present ? country.value : this.country, - dateTimeOriginal: dateTimeOriginal.present - ? dateTimeOriginal.value - : this.dateTimeOriginal, - description: description.present ? description.value : this.description, - height: height.present ? height.value : this.height, - width: width.present ? width.value : this.width, - exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime, - fNumber: fNumber.present ? fNumber.value : this.fNumber, - fileSize: fileSize.present ? fileSize.value : this.fileSize, - focalLength: focalLength.present ? focalLength.value : this.focalLength, - latitude: latitude.present ? latitude.value : this.latitude, - longitude: longitude.present ? longitude.value : this.longitude, - iso: iso.present ? iso.value : this.iso, - make: make.present ? make.value : this.make, - model: model.present ? model.value : this.model, - lens: lens.present ? lens.value : this.lens, - orientation: orientation.present ? orientation.value : this.orientation, - timeZone: timeZone.present ? timeZone.value : this.timeZone, - rating: rating.present ? rating.value : this.rating, - projectionType: projectionType.present - ? projectionType.value - : this.projectionType, - ); - RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) { - return RemoteExifEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - city: data.city.present ? data.city.value : this.city, - state: data.state.present ? data.state.value : this.state, - country: data.country.present ? data.country.value : this.country, - dateTimeOriginal: data.dateTimeOriginal.present - ? data.dateTimeOriginal.value - : this.dateTimeOriginal, - description: data.description.present - ? data.description.value - : this.description, - height: data.height.present ? data.height.value : this.height, - width: data.width.present ? data.width.value : this.width, - exposureTime: data.exposureTime.present - ? data.exposureTime.value - : this.exposureTime, - fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber, - fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize, - focalLength: data.focalLength.present - ? data.focalLength.value - : this.focalLength, - latitude: data.latitude.present ? data.latitude.value : this.latitude, - longitude: data.longitude.present ? data.longitude.value : this.longitude, - iso: data.iso.present ? data.iso.value : this.iso, - make: data.make.present ? data.make.value : this.make, - model: data.model.present ? data.model.value : this.model, - lens: data.lens.present ? data.lens.value : this.lens, - orientation: data.orientation.present - ? data.orientation.value - : this.orientation, - timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone, - rating: data.rating.present ? data.rating.value : this.rating, - projectionType: data.projectionType.present - ? data.projectionType.value - : this.projectionType, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityData(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hashAll([ - assetId, - city, - state, - country, - dateTimeOriginal, - description, - height, - width, - exposureTime, - fNumber, - fileSize, - focalLength, - latitude, - longitude, - iso, - make, - model, - lens, - orientation, - timeZone, - rating, - projectionType, - ]); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteExifEntityData && - other.assetId == this.assetId && - other.city == this.city && - other.state == this.state && - other.country == this.country && - other.dateTimeOriginal == this.dateTimeOriginal && - other.description == this.description && - other.height == this.height && - other.width == this.width && - other.exposureTime == this.exposureTime && - other.fNumber == this.fNumber && - other.fileSize == this.fileSize && - other.focalLength == this.focalLength && - other.latitude == this.latitude && - other.longitude == this.longitude && - other.iso == this.iso && - other.make == this.make && - other.model == this.model && - other.lens == this.lens && - other.orientation == this.orientation && - other.timeZone == this.timeZone && - other.rating == this.rating && - other.projectionType == this.projectionType); -} - -class RemoteExifEntityCompanion extends UpdateCompanion { - final Value assetId; - final Value city; - final Value state; - final Value country; - final Value dateTimeOriginal; - final Value description; - final Value height; - final Value width; - final Value exposureTime; - final Value fNumber; - final Value fileSize; - final Value focalLength; - final Value latitude; - final Value longitude; - final Value iso; - final Value make; - final Value model; - final Value lens; - final Value orientation; - final Value timeZone; - final Value rating; - final Value projectionType; - const RemoteExifEntityCompanion({ - this.assetId = const Value.absent(), - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }); - RemoteExifEntityCompanion.insert({ - required String assetId, - this.city = const Value.absent(), - this.state = const Value.absent(), - this.country = const Value.absent(), - this.dateTimeOriginal = const Value.absent(), - this.description = const Value.absent(), - this.height = const Value.absent(), - this.width = const Value.absent(), - this.exposureTime = const Value.absent(), - this.fNumber = const Value.absent(), - this.fileSize = const Value.absent(), - this.focalLength = const Value.absent(), - this.latitude = const Value.absent(), - this.longitude = const Value.absent(), - this.iso = const Value.absent(), - this.make = const Value.absent(), - this.model = const Value.absent(), - this.lens = const Value.absent(), - this.orientation = const Value.absent(), - this.timeZone = const Value.absent(), - this.rating = const Value.absent(), - this.projectionType = const Value.absent(), - }) : assetId = Value(assetId); - static Insertable custom({ - Expression? assetId, - Expression? city, - Expression? state, - Expression? country, - Expression? dateTimeOriginal, - Expression? description, - Expression? height, - Expression? width, - Expression? exposureTime, - Expression? fNumber, - Expression? fileSize, - Expression? focalLength, - Expression? latitude, - Expression? longitude, - Expression? iso, - Expression? make, - Expression? model, - Expression? lens, - Expression? orientation, - Expression? timeZone, - Expression? rating, - Expression? projectionType, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (city != null) 'city': city, - if (state != null) 'state': state, - if (country != null) 'country': country, - if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal, - if (description != null) 'description': description, - if (height != null) 'height': height, - if (width != null) 'width': width, - if (exposureTime != null) 'exposure_time': exposureTime, - if (fNumber != null) 'f_number': fNumber, - if (fileSize != null) 'file_size': fileSize, - if (focalLength != null) 'focal_length': focalLength, - if (latitude != null) 'latitude': latitude, - if (longitude != null) 'longitude': longitude, - if (iso != null) 'iso': iso, - if (make != null) 'make': make, - if (model != null) 'model': model, - if (lens != null) 'lens': lens, - if (orientation != null) 'orientation': orientation, - if (timeZone != null) 'time_zone': timeZone, - if (rating != null) 'rating': rating, - if (projectionType != null) 'projection_type': projectionType, - }); - } - - RemoteExifEntityCompanion copyWith({ - Value? assetId, - Value? city, - Value? state, - Value? country, - Value? dateTimeOriginal, - Value? description, - Value? height, - Value? width, - Value? exposureTime, - Value? fNumber, - Value? fileSize, - Value? focalLength, - Value? latitude, - Value? longitude, - Value? iso, - Value? make, - Value? model, - Value? lens, - Value? orientation, - Value? timeZone, - Value? rating, - Value? projectionType, - }) { - return RemoteExifEntityCompanion( - assetId: assetId ?? this.assetId, - city: city ?? this.city, - state: state ?? this.state, - country: country ?? this.country, - dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal, - description: description ?? this.description, - height: height ?? this.height, - width: width ?? this.width, - exposureTime: exposureTime ?? this.exposureTime, - fNumber: fNumber ?? this.fNumber, - fileSize: fileSize ?? this.fileSize, - focalLength: focalLength ?? this.focalLength, - latitude: latitude ?? this.latitude, - longitude: longitude ?? this.longitude, - iso: iso ?? this.iso, - make: make ?? this.make, - model: model ?? this.model, - lens: lens ?? this.lens, - orientation: orientation ?? this.orientation, - timeZone: timeZone ?? this.timeZone, - rating: rating ?? this.rating, - projectionType: projectionType ?? this.projectionType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (city.present) { - map['city'] = Variable(city.value); - } - if (state.present) { - map['state'] = Variable(state.value); - } - if (country.present) { - map['country'] = Variable(country.value); - } - if (dateTimeOriginal.present) { - map['date_time_original'] = Variable(dateTimeOriginal.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (height.present) { - map['height'] = Variable(height.value); - } - if (width.present) { - map['width'] = Variable(width.value); - } - if (exposureTime.present) { - map['exposure_time'] = Variable(exposureTime.value); - } - if (fNumber.present) { - map['f_number'] = Variable(fNumber.value); - } - if (fileSize.present) { - map['file_size'] = Variable(fileSize.value); - } - if (focalLength.present) { - map['focal_length'] = Variable(focalLength.value); - } - if (latitude.present) { - map['latitude'] = Variable(latitude.value); - } - if (longitude.present) { - map['longitude'] = Variable(longitude.value); - } - if (iso.present) { - map['iso'] = Variable(iso.value); - } - if (make.present) { - map['make'] = Variable(make.value); - } - if (model.present) { - map['model'] = Variable(model.value); - } - if (lens.present) { - map['lens'] = Variable(lens.value); - } - if (orientation.present) { - map['orientation'] = Variable(orientation.value); - } - if (timeZone.present) { - map['time_zone'] = Variable(timeZone.value); - } - if (rating.present) { - map['rating'] = Variable(rating.value); - } - if (projectionType.present) { - map['projection_type'] = Variable(projectionType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteExifEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('city: $city, ') - ..write('state: $state, ') - ..write('country: $country, ') - ..write('dateTimeOriginal: $dateTimeOriginal, ') - ..write('description: $description, ') - ..write('height: $height, ') - ..write('width: $width, ') - ..write('exposureTime: $exposureTime, ') - ..write('fNumber: $fNumber, ') - ..write('fileSize: $fileSize, ') - ..write('focalLength: $focalLength, ') - ..write('latitude: $latitude, ') - ..write('longitude: $longitude, ') - ..write('iso: $iso, ') - ..write('make: $make, ') - ..write('model: $model, ') - ..write('lens: $lens, ') - ..write('orientation: $orientation, ') - ..write('timeZone: $timeZone, ') - ..write('rating: $rating, ') - ..write('projectionType: $projectionType') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, albumId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_asset_entity'; - @override - Set get $primaryKey => {assetId, albumId}; - @override - RemoteAlbumAssetEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - ); - } - - @override - RemoteAlbumAssetEntity createAlias(String alias) { - return RemoteAlbumAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String albumId; - const RemoteAlbumAssetEntityData({ - required this.assetId, - required this.albumId, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['album_id'] = Variable(albumId); - return map; - } - - factory RemoteAlbumAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - albumId: serializer.fromJson(json['albumId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'albumId': serializer.toJson(albumId), - }; - } - - RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) => - RemoteAlbumAssetEntityData( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - RemoteAlbumAssetEntityData copyWithCompanion( - RemoteAlbumAssetEntityCompanion data, - ) { - return RemoteAlbumAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - albumId: data.albumId.present ? data.albumId.value : this.albumId, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, albumId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumAssetEntityData && - other.assetId == this.assetId && - other.albumId == this.albumId); -} - -class RemoteAlbumAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value albumId; - const RemoteAlbumAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.albumId = const Value.absent(), - }); - RemoteAlbumAssetEntityCompanion.insert({ - required String assetId, - required String albumId, - }) : assetId = Value(assetId), - albumId = Value(albumId); - static Insertable custom({ - Expression? assetId, - Expression? albumId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (albumId != null) 'album_id': albumId, - }); - } - - RemoteAlbumAssetEntityCompanion copyWith({ - Value? assetId, - Value? albumId, - }) { - return RemoteAlbumAssetEntityCompanion( - assetId: assetId ?? this.assetId, - albumId: albumId ?? this.albumId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('albumId: $albumId') - ..write(')')) - .toString(); - } -} - -class RemoteAlbumUserEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn albumId = GeneratedColumn( - 'album_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_album_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn userId = GeneratedColumn( - 'user_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - @override - List get $columns => [albumId, userId, role]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'remote_album_user_entity'; - @override - Set get $primaryKey => {albumId, userId}; - @override - RemoteAlbumUserEntityData map( - Map data, { - String? tablePrefix, - }) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return RemoteAlbumUserEntityData( - albumId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}album_id'], - )!, - userId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}user_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}role'], - )!, - ); - } - - @override - RemoteAlbumUserEntity createAlias(String alias) { - return RemoteAlbumUserEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class RemoteAlbumUserEntityData extends DataClass - implements Insertable { - final String albumId; - final String userId; - final int role; - const RemoteAlbumUserEntityData({ - required this.albumId, - required this.userId, - required this.role, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['album_id'] = Variable(albumId); - map['user_id'] = Variable(userId); - map['role'] = Variable(role); - return map; - } - - factory RemoteAlbumUserEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return RemoteAlbumUserEntityData( - albumId: serializer.fromJson(json['albumId']), - userId: serializer.fromJson(json['userId']), - role: serializer.fromJson(json['role']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'albumId': serializer.toJson(albumId), - 'userId': serializer.toJson(userId), - 'role': serializer.toJson(role), - }; - } - - RemoteAlbumUserEntityData copyWith({ - String? albumId, - String? userId, - int? role, - }) => RemoteAlbumUserEntityData( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - RemoteAlbumUserEntityData copyWithCompanion( - RemoteAlbumUserEntityCompanion data, - ) { - return RemoteAlbumUserEntityData( - albumId: data.albumId.present ? data.albumId.value : this.albumId, - userId: data.userId.present ? data.userId.value : this.userId, - role: data.role.present ? data.role.value : this.role, - ); - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityData(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(albumId, userId, role); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is RemoteAlbumUserEntityData && - other.albumId == this.albumId && - other.userId == this.userId && - other.role == this.role); -} - -class RemoteAlbumUserEntityCompanion - extends UpdateCompanion { - final Value albumId; - final Value userId; - final Value role; - const RemoteAlbumUserEntityCompanion({ - this.albumId = const Value.absent(), - this.userId = const Value.absent(), - this.role = const Value.absent(), - }); - RemoteAlbumUserEntityCompanion.insert({ - required String albumId, - required String userId, - required int role, - }) : albumId = Value(albumId), - userId = Value(userId), - role = Value(role); - static Insertable custom({ - Expression? albumId, - Expression? userId, - Expression? role, - }) { - return RawValuesInsertable({ - if (albumId != null) 'album_id': albumId, - if (userId != null) 'user_id': userId, - if (role != null) 'role': role, - }); - } - - RemoteAlbumUserEntityCompanion copyWith({ - Value? albumId, - Value? userId, - Value? role, - }) { - return RemoteAlbumUserEntityCompanion( - albumId: albumId ?? this.albumId, - userId: userId ?? this.userId, - role: role ?? this.role, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (albumId.present) { - map['album_id'] = Variable(albumId.value); - } - if (userId.present) { - map['user_id'] = Variable(userId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('RemoteAlbumUserEntityCompanion(') - ..write('albumId: $albumId, ') - ..write('userId: $userId, ') - ..write('role: $role') - ..write(')')) - .toString(); - } -} - -class MemoryEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn deletedAt = GeneratedColumn( - 'deleted_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn data = GeneratedColumn( - 'data', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn isSaved = GeneratedColumn( - 'is_saved', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_saved" IN (0, 1))', - ), - defaultValue: const CustomExpression('0'), - ); - late final GeneratedColumn memoryAt = GeneratedColumn( - 'memory_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - ); - late final GeneratedColumn seenAt = GeneratedColumn( - 'seen_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn showAt = GeneratedColumn( - 'show_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - late final GeneratedColumn hideAt = GeneratedColumn( - 'hide_at', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_entity'; - @override - Set get $primaryKey => {id}; - @override - MemoryEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - deletedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}deleted_at'], - ), - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}type'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - isSaved: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_saved'], - )!, - memoryAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}memory_at'], - )!, - seenAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}seen_at'], - ), - showAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}show_at'], - ), - hideAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}hide_at'], - ), - ); - } - - @override - MemoryEntity createAlias(String alias) { - return MemoryEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final DateTime? deletedAt; - final String ownerId; - final int type; - final String data; - final bool isSaved; - final DateTime memoryAt; - final DateTime? seenAt; - final DateTime? showAt; - final DateTime? hideAt; - const MemoryEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - this.deletedAt, - required this.ownerId, - required this.type, - required this.data, - required this.isSaved, - required this.memoryAt, - this.seenAt, - this.showAt, - this.hideAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - if (!nullToAbsent || deletedAt != null) { - map['deleted_at'] = Variable(deletedAt); - } - map['owner_id'] = Variable(ownerId); - map['type'] = Variable(type); - map['data'] = Variable(data); - map['is_saved'] = Variable(isSaved); - map['memory_at'] = Variable(memoryAt); - if (!nullToAbsent || seenAt != null) { - map['seen_at'] = Variable(seenAt); - } - if (!nullToAbsent || showAt != null) { - map['show_at'] = Variable(showAt); - } - if (!nullToAbsent || hideAt != null) { - map['hide_at'] = Variable(hideAt); - } - return map; - } - - factory MemoryEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - deletedAt: serializer.fromJson(json['deletedAt']), - ownerId: serializer.fromJson(json['ownerId']), - type: serializer.fromJson(json['type']), - data: serializer.fromJson(json['data']), - isSaved: serializer.fromJson(json['isSaved']), - memoryAt: serializer.fromJson(json['memoryAt']), - seenAt: serializer.fromJson(json['seenAt']), - showAt: serializer.fromJson(json['showAt']), - hideAt: serializer.fromJson(json['hideAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'deletedAt': serializer.toJson(deletedAt), - 'ownerId': serializer.toJson(ownerId), - 'type': serializer.toJson(type), - 'data': serializer.toJson(data), - 'isSaved': serializer.toJson(isSaved), - 'memoryAt': serializer.toJson(memoryAt), - 'seenAt': serializer.toJson(seenAt), - 'showAt': serializer.toJson(showAt), - 'hideAt': serializer.toJson(hideAt), - }; - } - - MemoryEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - Value deletedAt = const Value.absent(), - String? ownerId, - int? type, - String? data, - bool? isSaved, - DateTime? memoryAt, - Value seenAt = const Value.absent(), - Value showAt = const Value.absent(), - Value hideAt = const Value.absent(), - }) => MemoryEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt.present ? seenAt.value : this.seenAt, - showAt: showAt.present ? showAt.value : this.showAt, - hideAt: hideAt.present ? hideAt.value : this.hideAt, - ); - MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) { - return MemoryEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - type: data.type.present ? data.type.value : this.type, - data: data.data.present ? data.data.value : this.data, - isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved, - memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt, - seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt, - showAt: data.showAt.present ? data.showAt.value : this.showAt, - hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - deletedAt, - ownerId, - type, - data, - isSaved, - memoryAt, - seenAt, - showAt, - hideAt, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.deletedAt == this.deletedAt && - other.ownerId == this.ownerId && - other.type == this.type && - other.data == this.data && - other.isSaved == this.isSaved && - other.memoryAt == this.memoryAt && - other.seenAt == this.seenAt && - other.showAt == this.showAt && - other.hideAt == this.hideAt); -} - -class MemoryEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value deletedAt; - final Value ownerId; - final Value type; - final Value data; - final Value isSaved; - final Value memoryAt; - final Value seenAt; - final Value showAt; - final Value hideAt; - const MemoryEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.type = const Value.absent(), - this.data = const Value.absent(), - this.isSaved = const Value.absent(), - this.memoryAt = const Value.absent(), - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }); - MemoryEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.deletedAt = const Value.absent(), - required String ownerId, - required int type, - required String data, - this.isSaved = const Value.absent(), - required DateTime memoryAt, - this.seenAt = const Value.absent(), - this.showAt = const Value.absent(), - this.hideAt = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - type = Value(type), - data = Value(data), - memoryAt = Value(memoryAt); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? deletedAt, - Expression? ownerId, - Expression? type, - Expression? data, - Expression? isSaved, - Expression? memoryAt, - Expression? seenAt, - Expression? showAt, - Expression? hideAt, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (deletedAt != null) 'deleted_at': deletedAt, - if (ownerId != null) 'owner_id': ownerId, - if (type != null) 'type': type, - if (data != null) 'data': data, - if (isSaved != null) 'is_saved': isSaved, - if (memoryAt != null) 'memory_at': memoryAt, - if (seenAt != null) 'seen_at': seenAt, - if (showAt != null) 'show_at': showAt, - if (hideAt != null) 'hide_at': hideAt, - }); - } - - MemoryEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? deletedAt, - Value? ownerId, - Value? type, - Value? data, - Value? isSaved, - Value? memoryAt, - Value? seenAt, - Value? showAt, - Value? hideAt, - }) { - return MemoryEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - deletedAt: deletedAt ?? this.deletedAt, - ownerId: ownerId ?? this.ownerId, - type: type ?? this.type, - data: data ?? this.data, - isSaved: isSaved ?? this.isSaved, - memoryAt: memoryAt ?? this.memoryAt, - seenAt: seenAt ?? this.seenAt, - showAt: showAt ?? this.showAt, - hideAt: hideAt ?? this.hideAt, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (deletedAt.present) { - map['deleted_at'] = Variable(deletedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (data.present) { - map['data'] = Variable(data.value); - } - if (isSaved.present) { - map['is_saved'] = Variable(isSaved.value); - } - if (memoryAt.present) { - map['memory_at'] = Variable(memoryAt.value); - } - if (seenAt.present) { - map['seen_at'] = Variable(seenAt.value); - } - if (showAt.present) { - map['show_at'] = Variable(showAt.value); - } - if (hideAt.present) { - map['hide_at'] = Variable(hideAt.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('deletedAt: $deletedAt, ') - ..write('ownerId: $ownerId, ') - ..write('type: $type, ') - ..write('data: $data, ') - ..write('isSaved: $isSaved, ') - ..write('memoryAt: $memoryAt, ') - ..write('seenAt: $seenAt, ') - ..write('showAt: $showAt, ') - ..write('hideAt: $hideAt') - ..write(')')) - .toString(); - } -} - -class MemoryAssetEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - MemoryAssetEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn memoryId = GeneratedColumn( - 'memory_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES memory_entity (id) ON DELETE CASCADE', - ), - ); - @override - List get $columns => [assetId, memoryId]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'memory_asset_entity'; - @override - Set get $primaryKey => {assetId, memoryId}; - @override - MemoryAssetEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return MemoryAssetEntityData( - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - memoryId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}memory_id'], - )!, - ); - } - - @override - MemoryAssetEntity createAlias(String alias) { - return MemoryAssetEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class MemoryAssetEntityData extends DataClass - implements Insertable { - final String assetId; - final String memoryId; - const MemoryAssetEntityData({required this.assetId, required this.memoryId}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['asset_id'] = Variable(assetId); - map['memory_id'] = Variable(memoryId); - return map; - } - - factory MemoryAssetEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return MemoryAssetEntityData( - assetId: serializer.fromJson(json['assetId']), - memoryId: serializer.fromJson(json['memoryId']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'assetId': serializer.toJson(assetId), - 'memoryId': serializer.toJson(memoryId), - }; - } - - MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) => - MemoryAssetEntityData( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) { - return MemoryAssetEntityData( - assetId: data.assetId.present ? data.assetId.value : this.assetId, - memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId, - ); - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityData(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(assetId, memoryId); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is MemoryAssetEntityData && - other.assetId == this.assetId && - other.memoryId == this.memoryId); -} - -class MemoryAssetEntityCompanion - extends UpdateCompanion { - final Value assetId; - final Value memoryId; - const MemoryAssetEntityCompanion({ - this.assetId = const Value.absent(), - this.memoryId = const Value.absent(), - }); - MemoryAssetEntityCompanion.insert({ - required String assetId, - required String memoryId, - }) : assetId = Value(assetId), - memoryId = Value(memoryId); - static Insertable custom({ - Expression? assetId, - Expression? memoryId, - }) { - return RawValuesInsertable({ - if (assetId != null) 'asset_id': assetId, - if (memoryId != null) 'memory_id': memoryId, - }); - } - - MemoryAssetEntityCompanion copyWith({ - Value? assetId, - Value? memoryId, - }) { - return MemoryAssetEntityCompanion( - assetId: assetId ?? this.assetId, - memoryId: memoryId ?? this.memoryId, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (memoryId.present) { - map['memory_id'] = Variable(memoryId.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('MemoryAssetEntityCompanion(') - ..write('assetId: $assetId, ') - ..write('memoryId: $memoryId') - ..write(')')) - .toString(); - } -} - -class PersonEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - PersonEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - defaultValue: const CustomExpression('CURRENT_TIMESTAMP'), - ); - late final GeneratedColumn ownerId = GeneratedColumn( - 'owner_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES user_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn faceAssetId = GeneratedColumn( - 'face_asset_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn isFavorite = GeneratedColumn( - 'is_favorite', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_favorite" IN (0, 1))', - ), - ); - late final GeneratedColumn isHidden = GeneratedColumn( - 'is_hidden', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("is_hidden" IN (0, 1))', - ), - ); - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn birthDate = GeneratedColumn( - 'birth_date', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'person_entity'; - @override - Set get $primaryKey => {id}; - @override - PersonEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return PersonEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated_at'], - )!, - ownerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}owner_id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - faceAssetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}face_asset_id'], - ), - isFavorite: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_favorite'], - )!, - isHidden: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}is_hidden'], - )!, - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - birthDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}birth_date'], - ), - ); - } - - @override - PersonEntity createAlias(String alias) { - return PersonEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class PersonEntityData extends DataClass - implements Insertable { - final String id; - final DateTime createdAt; - final DateTime updatedAt; - final String ownerId; - final String name; - final String? faceAssetId; - final bool isFavorite; - final bool isHidden; - final String? color; - final DateTime? birthDate; - const PersonEntityData({ - required this.id, - required this.createdAt, - required this.updatedAt, - required this.ownerId, - required this.name, - this.faceAssetId, - required this.isFavorite, - required this.isHidden, - this.color, - this.birthDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - map['owner_id'] = Variable(ownerId); - map['name'] = Variable(name); - if (!nullToAbsent || faceAssetId != null) { - map['face_asset_id'] = Variable(faceAssetId); - } - map['is_favorite'] = Variable(isFavorite); - map['is_hidden'] = Variable(isHidden); - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } - return map; - } - - factory PersonEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return PersonEntityData( - id: serializer.fromJson(json['id']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ownerId: serializer.fromJson(json['ownerId']), - name: serializer.fromJson(json['name']), - faceAssetId: serializer.fromJson(json['faceAssetId']), - isFavorite: serializer.fromJson(json['isFavorite']), - isHidden: serializer.fromJson(json['isHidden']), - color: serializer.fromJson(json['color']), - birthDate: serializer.fromJson(json['birthDate']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - 'ownerId': serializer.toJson(ownerId), - 'name': serializer.toJson(name), - 'faceAssetId': serializer.toJson(faceAssetId), - 'isFavorite': serializer.toJson(isFavorite), - 'isHidden': serializer.toJson(isHidden), - 'color': serializer.toJson(color), - 'birthDate': serializer.toJson(birthDate), - }; - } - - PersonEntityData copyWith({ - String? id, - DateTime? createdAt, - DateTime? updatedAt, - String? ownerId, - String? name, - Value faceAssetId = const Value.absent(), - bool? isFavorite, - bool? isHidden, - Value color = const Value.absent(), - Value birthDate = const Value.absent(), - }) => PersonEntityData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color.present ? color.value : this.color, - birthDate: birthDate.present ? birthDate.value : this.birthDate, - ); - PersonEntityData copyWithCompanion(PersonEntityCompanion data) { - return PersonEntityData( - id: data.id.present ? data.id.value : this.id, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId, - name: data.name.present ? data.name.value : this.name, - faceAssetId: data.faceAssetId.present - ? data.faceAssetId.value - : this.faceAssetId, - isFavorite: data.isFavorite.present - ? data.isFavorite.value - : this.isFavorite, - isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden, - color: data.color.present ? data.color.value : this.color, - birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate, - ); - } - - @override - String toString() { - return (StringBuffer('PersonEntityData(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - createdAt, - updatedAt, - ownerId, - name, - faceAssetId, - isFavorite, - isHidden, - color, - birthDate, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is PersonEntityData && - other.id == this.id && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt && - other.ownerId == this.ownerId && - other.name == this.name && - other.faceAssetId == this.faceAssetId && - other.isFavorite == this.isFavorite && - other.isHidden == this.isHidden && - other.color == this.color && - other.birthDate == this.birthDate); -} - -class PersonEntityCompanion extends UpdateCompanion { - final Value id; - final Value createdAt; - final Value updatedAt; - final Value ownerId; - final Value name; - final Value faceAssetId; - final Value isFavorite; - final Value isHidden; - final Value color; - final Value birthDate; - const PersonEntityCompanion({ - this.id = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.ownerId = const Value.absent(), - this.name = const Value.absent(), - this.faceAssetId = const Value.absent(), - this.isFavorite = const Value.absent(), - this.isHidden = const Value.absent(), - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }); - PersonEntityCompanion.insert({ - required String id, - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - required String ownerId, - required String name, - this.faceAssetId = const Value.absent(), - required bool isFavorite, - required bool isHidden, - this.color = const Value.absent(), - this.birthDate = const Value.absent(), - }) : id = Value(id), - ownerId = Value(ownerId), - name = Value(name), - isFavorite = Value(isFavorite), - isHidden = Value(isHidden); - static Insertable custom({ - Expression? id, - Expression? createdAt, - Expression? updatedAt, - Expression? ownerId, - Expression? name, - Expression? faceAssetId, - Expression? isFavorite, - Expression? isHidden, - Expression? color, - Expression? birthDate, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (ownerId != null) 'owner_id': ownerId, - if (name != null) 'name': name, - if (faceAssetId != null) 'face_asset_id': faceAssetId, - if (isFavorite != null) 'is_favorite': isFavorite, - if (isHidden != null) 'is_hidden': isHidden, - if (color != null) 'color': color, - if (birthDate != null) 'birth_date': birthDate, - }); - } - - PersonEntityCompanion copyWith({ - Value? id, - Value? createdAt, - Value? updatedAt, - Value? ownerId, - Value? name, - Value? faceAssetId, - Value? isFavorite, - Value? isHidden, - Value? color, - Value? birthDate, - }) { - return PersonEntityCompanion( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ownerId: ownerId ?? this.ownerId, - name: name ?? this.name, - faceAssetId: faceAssetId ?? this.faceAssetId, - isFavorite: isFavorite ?? this.isFavorite, - isHidden: isHidden ?? this.isHidden, - color: color ?? this.color, - birthDate: birthDate ?? this.birthDate, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (ownerId.present) { - map['owner_id'] = Variable(ownerId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (faceAssetId.present) { - map['face_asset_id'] = Variable(faceAssetId.value); - } - if (isFavorite.present) { - map['is_favorite'] = Variable(isFavorite.value); - } - if (isHidden.present) { - map['is_hidden'] = Variable(isHidden.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (birthDate.present) { - map['birth_date'] = Variable(birthDate.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('PersonEntityCompanion(') - ..write('id: $id, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('ownerId: $ownerId, ') - ..write('name: $name, ') - ..write('faceAssetId: $faceAssetId, ') - ..write('isFavorite: $isFavorite, ') - ..write('isHidden: $isHidden, ') - ..write('color: $color, ') - ..write('birthDate: $birthDate') - ..write(')')) - .toString(); - } -} - -class AssetFaceEntity extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - AssetFaceEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - late final GeneratedColumn assetId = GeneratedColumn( - 'asset_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE', - ), - ); - late final GeneratedColumn personId = GeneratedColumn( - 'person_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES person_entity (id) ON DELETE SET NULL', - ), - ); - late final GeneratedColumn imageWidth = GeneratedColumn( - 'image_width', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn imageHeight = GeneratedColumn( - 'image_height', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX1 = GeneratedColumn( - 'bounding_box_x1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY1 = GeneratedColumn( - 'bounding_box_y1', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxX2 = GeneratedColumn( - 'bounding_box_x2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn boundingBoxY2 = GeneratedColumn( - 'bounding_box_y2', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn sourceType = GeneratedColumn( - 'source_type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'asset_face_entity'; - @override - Set get $primaryKey => {id}; - @override - AssetFaceEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AssetFaceEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - assetId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}asset_id'], - )!, - personId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}person_id'], - ), - imageWidth: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_width'], - )!, - imageHeight: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}image_height'], - )!, - boundingBoxX1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x1'], - )!, - boundingBoxY1: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y1'], - )!, - boundingBoxX2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_x2'], - )!, - boundingBoxY2: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}bounding_box_y2'], - )!, - sourceType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}source_type'], - )!, - ); - } - - @override - AssetFaceEntity createAlias(String alias) { - return AssetFaceEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class AssetFaceEntityData extends DataClass - implements Insertable { - final String id; - final String assetId; - final String? personId; - final int imageWidth; - final int imageHeight; - final int boundingBoxX1; - final int boundingBoxY1; - final int boundingBoxX2; - final int boundingBoxY2; - final String sourceType; - const AssetFaceEntityData({ - required this.id, - required this.assetId, - this.personId, - required this.imageWidth, - required this.imageHeight, - required this.boundingBoxX1, - required this.boundingBoxY1, - required this.boundingBoxX2, - required this.boundingBoxY2, - required this.sourceType, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['asset_id'] = Variable(assetId); - if (!nullToAbsent || personId != null) { - map['person_id'] = Variable(personId); - } - map['image_width'] = Variable(imageWidth); - map['image_height'] = Variable(imageHeight); - map['bounding_box_x1'] = Variable(boundingBoxX1); - map['bounding_box_y1'] = Variable(boundingBoxY1); - map['bounding_box_x2'] = Variable(boundingBoxX2); - map['bounding_box_y2'] = Variable(boundingBoxY2); - map['source_type'] = Variable(sourceType); - return map; - } - - factory AssetFaceEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AssetFaceEntityData( - id: serializer.fromJson(json['id']), - assetId: serializer.fromJson(json['assetId']), - personId: serializer.fromJson(json['personId']), - imageWidth: serializer.fromJson(json['imageWidth']), - imageHeight: serializer.fromJson(json['imageHeight']), - boundingBoxX1: serializer.fromJson(json['boundingBoxX1']), - boundingBoxY1: serializer.fromJson(json['boundingBoxY1']), - boundingBoxX2: serializer.fromJson(json['boundingBoxX2']), - boundingBoxY2: serializer.fromJson(json['boundingBoxY2']), - sourceType: serializer.fromJson(json['sourceType']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'assetId': serializer.toJson(assetId), - 'personId': serializer.toJson(personId), - 'imageWidth': serializer.toJson(imageWidth), - 'imageHeight': serializer.toJson(imageHeight), - 'boundingBoxX1': serializer.toJson(boundingBoxX1), - 'boundingBoxY1': serializer.toJson(boundingBoxY1), - 'boundingBoxX2': serializer.toJson(boundingBoxX2), - 'boundingBoxY2': serializer.toJson(boundingBoxY2), - 'sourceType': serializer.toJson(sourceType), - }; - } - - AssetFaceEntityData copyWith({ - String? id, - String? assetId, - Value personId = const Value.absent(), - int? imageWidth, - int? imageHeight, - int? boundingBoxX1, - int? boundingBoxY1, - int? boundingBoxX2, - int? boundingBoxY2, - String? sourceType, - }) => AssetFaceEntityData( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId.present ? personId.value : this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) { - return AssetFaceEntityData( - id: data.id.present ? data.id.value : this.id, - assetId: data.assetId.present ? data.assetId.value : this.assetId, - personId: data.personId.present ? data.personId.value : this.personId, - imageWidth: data.imageWidth.present - ? data.imageWidth.value - : this.imageWidth, - imageHeight: data.imageHeight.present - ? data.imageHeight.value - : this.imageHeight, - boundingBoxX1: data.boundingBoxX1.present - ? data.boundingBoxX1.value - : this.boundingBoxX1, - boundingBoxY1: data.boundingBoxY1.present - ? data.boundingBoxY1.value - : this.boundingBoxY1, - boundingBoxX2: data.boundingBoxX2.present - ? data.boundingBoxX2.value - : this.boundingBoxX2, - boundingBoxY2: data.boundingBoxY2.present - ? data.boundingBoxY2.value - : this.boundingBoxY2, - sourceType: data.sourceType.present - ? data.sourceType.value - : this.sourceType, - ); - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityData(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - assetId, - personId, - imageWidth, - imageHeight, - boundingBoxX1, - boundingBoxY1, - boundingBoxX2, - boundingBoxY2, - sourceType, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AssetFaceEntityData && - other.id == this.id && - other.assetId == this.assetId && - other.personId == this.personId && - other.imageWidth == this.imageWidth && - other.imageHeight == this.imageHeight && - other.boundingBoxX1 == this.boundingBoxX1 && - other.boundingBoxY1 == this.boundingBoxY1 && - other.boundingBoxX2 == this.boundingBoxX2 && - other.boundingBoxY2 == this.boundingBoxY2 && - other.sourceType == this.sourceType); -} - -class AssetFaceEntityCompanion extends UpdateCompanion { - final Value id; - final Value assetId; - final Value personId; - final Value imageWidth; - final Value imageHeight; - final Value boundingBoxX1; - final Value boundingBoxY1; - final Value boundingBoxX2; - final Value boundingBoxY2; - final Value sourceType; - const AssetFaceEntityCompanion({ - this.id = const Value.absent(), - this.assetId = const Value.absent(), - this.personId = const Value.absent(), - this.imageWidth = const Value.absent(), - this.imageHeight = const Value.absent(), - this.boundingBoxX1 = const Value.absent(), - this.boundingBoxY1 = const Value.absent(), - this.boundingBoxX2 = const Value.absent(), - this.boundingBoxY2 = const Value.absent(), - this.sourceType = const Value.absent(), - }); - AssetFaceEntityCompanion.insert({ - required String id, - required String assetId, - this.personId = const Value.absent(), - required int imageWidth, - required int imageHeight, - required int boundingBoxX1, - required int boundingBoxY1, - required int boundingBoxX2, - required int boundingBoxY2, - required String sourceType, - }) : id = Value(id), - assetId = Value(assetId), - imageWidth = Value(imageWidth), - imageHeight = Value(imageHeight), - boundingBoxX1 = Value(boundingBoxX1), - boundingBoxY1 = Value(boundingBoxY1), - boundingBoxX2 = Value(boundingBoxX2), - boundingBoxY2 = Value(boundingBoxY2), - sourceType = Value(sourceType); - static Insertable custom({ - Expression? id, - Expression? assetId, - Expression? personId, - Expression? imageWidth, - Expression? imageHeight, - Expression? boundingBoxX1, - Expression? boundingBoxY1, - Expression? boundingBoxX2, - Expression? boundingBoxY2, - Expression? sourceType, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (assetId != null) 'asset_id': assetId, - if (personId != null) 'person_id': personId, - if (imageWidth != null) 'image_width': imageWidth, - if (imageHeight != null) 'image_height': imageHeight, - if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1, - if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1, - if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2, - if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2, - if (sourceType != null) 'source_type': sourceType, - }); - } - - AssetFaceEntityCompanion copyWith({ - Value? id, - Value? assetId, - Value? personId, - Value? imageWidth, - Value? imageHeight, - Value? boundingBoxX1, - Value? boundingBoxY1, - Value? boundingBoxX2, - Value? boundingBoxY2, - Value? sourceType, - }) { - return AssetFaceEntityCompanion( - id: id ?? this.id, - assetId: assetId ?? this.assetId, - personId: personId ?? this.personId, - imageWidth: imageWidth ?? this.imageWidth, - imageHeight: imageHeight ?? this.imageHeight, - boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1, - boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1, - boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2, - boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2, - sourceType: sourceType ?? this.sourceType, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (assetId.present) { - map['asset_id'] = Variable(assetId.value); - } - if (personId.present) { - map['person_id'] = Variable(personId.value); - } - if (imageWidth.present) { - map['image_width'] = Variable(imageWidth.value); - } - if (imageHeight.present) { - map['image_height'] = Variable(imageHeight.value); - } - if (boundingBoxX1.present) { - map['bounding_box_x1'] = Variable(boundingBoxX1.value); - } - if (boundingBoxY1.present) { - map['bounding_box_y1'] = Variable(boundingBoxY1.value); - } - if (boundingBoxX2.present) { - map['bounding_box_x2'] = Variable(boundingBoxX2.value); - } - if (boundingBoxY2.present) { - map['bounding_box_y2'] = Variable(boundingBoxY2.value); - } - if (sourceType.present) { - map['source_type'] = Variable(sourceType.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AssetFaceEntityCompanion(') - ..write('id: $id, ') - ..write('assetId: $assetId, ') - ..write('personId: $personId, ') - ..write('imageWidth: $imageWidth, ') - ..write('imageHeight: $imageHeight, ') - ..write('boundingBoxX1: $boundingBoxX1, ') - ..write('boundingBoxY1: $boundingBoxY1, ') - ..write('boundingBoxX2: $boundingBoxX2, ') - ..write('boundingBoxY2: $boundingBoxY2, ') - ..write('sourceType: $sourceType') - ..write(')')) - .toString(); - } -} - -class StoreEntity extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - StoreEntity(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - late final GeneratedColumn stringValue = GeneratedColumn( - 'string_value', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - late final GeneratedColumn intValue = GeneratedColumn( - 'int_value', - aliasedName, - true, - type: DriftSqlType.int, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, stringValue, intValue]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'store_entity'; - @override - Set get $primaryKey => {id}; - @override - StoreEntityData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return StoreEntityData( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - stringValue: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}string_value'], - ), - intValue: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}int_value'], - ), - ); - } - - @override - StoreEntity createAlias(String alias) { - return StoreEntity(attachedDatabase, alias); - } - - @override - bool get withoutRowId => true; - @override - bool get isStrict => true; -} - -class StoreEntityData extends DataClass implements Insertable { - final int id; - final String? stringValue; - final int? intValue; - const StoreEntityData({required this.id, this.stringValue, this.intValue}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || stringValue != null) { - map['string_value'] = Variable(stringValue); - } - if (!nullToAbsent || intValue != null) { - map['int_value'] = Variable(intValue); - } - return map; - } - - factory StoreEntityData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return StoreEntityData( - id: serializer.fromJson(json['id']), - stringValue: serializer.fromJson(json['stringValue']), - intValue: serializer.fromJson(json['intValue']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'stringValue': serializer.toJson(stringValue), - 'intValue': serializer.toJson(intValue), - }; - } - - StoreEntityData copyWith({ - int? id, - Value stringValue = const Value.absent(), - Value intValue = const Value.absent(), - }) => StoreEntityData( - id: id ?? this.id, - stringValue: stringValue.present ? stringValue.value : this.stringValue, - intValue: intValue.present ? intValue.value : this.intValue, - ); - StoreEntityData copyWithCompanion(StoreEntityCompanion data) { - return StoreEntityData( - id: data.id.present ? data.id.value : this.id, - stringValue: data.stringValue.present - ? data.stringValue.value - : this.stringValue, - intValue: data.intValue.present ? data.intValue.value : this.intValue, - ); - } - - @override - String toString() { - return (StringBuffer('StoreEntityData(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, stringValue, intValue); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is StoreEntityData && - other.id == this.id && - other.stringValue == this.stringValue && - other.intValue == this.intValue); -} - -class StoreEntityCompanion extends UpdateCompanion { - final Value id; - final Value stringValue; - final Value intValue; - const StoreEntityCompanion({ - this.id = const Value.absent(), - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }); - StoreEntityCompanion.insert({ - required int id, - this.stringValue = const Value.absent(), - this.intValue = const Value.absent(), - }) : id = Value(id); - static Insertable custom({ - Expression? id, - Expression? stringValue, - Expression? intValue, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (stringValue != null) 'string_value': stringValue, - if (intValue != null) 'int_value': intValue, - }); - } - - StoreEntityCompanion copyWith({ - Value? id, - Value? stringValue, - Value? intValue, - }) { - return StoreEntityCompanion( - id: id ?? this.id, - stringValue: stringValue ?? this.stringValue, - intValue: intValue ?? this.intValue, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (stringValue.present) { - map['string_value'] = Variable(stringValue.value); - } - if (intValue.present) { - map['int_value'] = Variable(intValue.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('StoreEntityCompanion(') - ..write('id: $id, ') - ..write('stringValue: $stringValue, ') - ..write('intValue: $intValue') - ..write(')')) - .toString(); - } -} - -class DatabaseAtV9 extends GeneratedDatabase { - DatabaseAtV9(QueryExecutor e) : super(e); - late final UserEntity userEntity = UserEntity(this); - late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this); - late final StackEntity stackEntity = StackEntity(this); - late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this); - late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this); - late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this); - late final LocalAlbumAssetEntity localAlbumAssetEntity = - LocalAlbumAssetEntity(this); - late final Index idxLocalAssetChecksum = Index( - 'idx_local_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)', - ); - late final Index idxRemoteAssetOwnerChecksum = Index( - 'idx_remote_asset_owner_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)', - ); - late final Index uQRemoteAssetsOwnerChecksum = Index( - 'UQ_remote_assets_owner_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)', - ); - late final Index uQRemoteAssetsOwnerLibraryChecksum = Index( - 'UQ_remote_assets_owner_library_checksum', - 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)', - ); - late final Index idxRemoteAssetChecksum = Index( - 'idx_remote_asset_checksum', - 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)', - ); - late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this); - late final PartnerEntity partnerEntity = PartnerEntity(this); - late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this); - late final RemoteAlbumAssetEntity remoteAlbumAssetEntity = - RemoteAlbumAssetEntity(this); - late final RemoteAlbumUserEntity remoteAlbumUserEntity = - RemoteAlbumUserEntity(this); - late final MemoryEntity memoryEntity = MemoryEntity(this); - late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this); - late final PersonEntity personEntity = PersonEntity(this); - late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this); - late final StoreEntity storeEntity = StoreEntity(this); - late final Index idxLatLng = Index( - 'idx_lat_lng', - 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)', - ); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - userEntity, - remoteAssetEntity, - stackEntity, - localAssetEntity, - remoteAlbumEntity, - localAlbumEntity, - localAlbumAssetEntity, - idxLocalAssetChecksum, - idxRemoteAssetOwnerChecksum, - uQRemoteAssetsOwnerChecksum, - uQRemoteAssetsOwnerLibraryChecksum, - idxRemoteAssetChecksum, - userMetadataEntity, - partnerEntity, - remoteExifEntity, - remoteAlbumAssetEntity, - remoteAlbumUserEntity, - memoryEntity, - memoryAssetEntity, - personEntity, - assetFaceEntity, - storeEntity, - idxLatLng, - ]; - @override - int get schemaVersion => 9; - @override - DriftDatabaseOptions get options => - const DriftDatabaseOptions(storeDateTimeAsText: true); -}