drift(mobile): drift auth user sync
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||
import 'package:immich_mobile/domain/models/user_metadata.model.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
||||
|
||||
class AuthUserEntity extends Table with DriftDefaultsMixin {
|
||||
const AuthUserEntity();
|
||||
|
||||
TextColumn get id => text()();
|
||||
|
||||
TextColumn get name => text()();
|
||||
|
||||
TextColumn get email => text()();
|
||||
|
||||
DateTimeColumn get deletedAt => dateTime().nullable()();
|
||||
|
||||
IntColumn get avatarColor => intEnum<AvatarColor>().nullable()();
|
||||
|
||||
BoolColumn get isAdmin => boolean().withDefault(const Constant(false))();
|
||||
|
||||
TextColumn get oauthId => text().withDefault(const Constant(''))();
|
||||
|
||||
TextColumn get pinCode => text().nullable()();
|
||||
|
||||
BoolColumn get hasProfileImage => boolean().withDefault(const Constant(false))();
|
||||
|
||||
DateTimeColumn get profileChangedAt => dateTime().withDefault(currentDateAndTime)();
|
||||
|
||||
IntColumn get quotaSizeInBytes => integer().nullable()();
|
||||
|
||||
IntColumn get quotaUsageInBytes => integer().withDefault(const Constant(0))();
|
||||
|
||||
TextColumn get storageLabel => text().nullable()();
|
||||
|
||||
@override
|
||||
Set<Column> get primaryKey => {id};
|
||||
}
|
||||
|
||||
extension AuthUserEntityDataDomainEx on AuthUserEntityData {
|
||||
AuthUser toDto() => AuthUser(
|
||||
id: id,
|
||||
name: name,
|
||||
email: email,
|
||||
deletedAt: deletedAt,
|
||||
avatarColor: avatarColor,
|
||||
isAdmin: isAdmin,
|
||||
oauthId: oauthId,
|
||||
pinCode: pinCode,
|
||||
hasProfileImage: hasProfileImage,
|
||||
profileChangedAt: profileChangedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes,
|
||||
storageLabel: storageLabel,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,951 @@
|
||||
// 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_metadata.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<DateTime?> deletedAt,
|
||||
i0.Value<i2.AvatarColor?> avatarColor,
|
||||
i0.Value<bool> isAdmin,
|
||||
i0.Value<String> oauthId,
|
||||
i0.Value<String?> pinCode,
|
||||
i0.Value<bool> hasProfileImage,
|
||||
i0.Value<DateTime> profileChangedAt,
|
||||
i0.Value<int?> quotaSizeInBytes,
|
||||
i0.Value<int> quotaUsageInBytes,
|
||||
i0.Value<String?> storageLabel,
|
||||
});
|
||||
typedef $$AuthUserEntityTableUpdateCompanionBuilder = i1.AuthUserEntityCompanion
|
||||
Function({
|
||||
i0.Value<String> id,
|
||||
i0.Value<String> name,
|
||||
i0.Value<String> email,
|
||||
i0.Value<DateTime?> deletedAt,
|
||||
i0.Value<i2.AvatarColor?> avatarColor,
|
||||
i0.Value<bool> isAdmin,
|
||||
i0.Value<String> oauthId,
|
||||
i0.Value<String?> pinCode,
|
||||
i0.Value<bool> hasProfileImage,
|
||||
i0.Value<DateTime> profileChangedAt,
|
||||
i0.Value<int?> quotaSizeInBytes,
|
||||
i0.Value<int> quotaUsageInBytes,
|
||||
i0.Value<String?> storageLabel,
|
||||
});
|
||||
|
||||
class $$AuthUserEntityTableFilterComposer
|
||||
extends i0.Composer<i0.GeneratedDatabase, i1.$AuthUserEntityTable> {
|
||||
$$AuthUserEntityTableFilterComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
super.joinBuilder,
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
i0.ColumnFilters<String> get id => $composableBuilder(
|
||||
column: $table.id, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get name => $composableBuilder(
|
||||
column: $table.name, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get email => $composableBuilder(
|
||||
column: $table.email, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
||||
column: $table.deletedAt, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnWithTypeConverterFilters<i2.AvatarColor?, i2.AvatarColor, int>
|
||||
get avatarColor => $composableBuilder(
|
||||
column: $table.avatarColor,
|
||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
||||
|
||||
i0.ColumnFilters<bool> get isAdmin => $composableBuilder(
|
||||
column: $table.isAdmin, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get oauthId => $composableBuilder(
|
||||
column: $table.oauthId, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get pinCode => $composableBuilder(
|
||||
column: $table.pinCode, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<bool> get hasProfileImage => $composableBuilder(
|
||||
column: $table.hasProfileImage,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<DateTime> get profileChangedAt => $composableBuilder(
|
||||
column: $table.profileChangedAt,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<int> get quotaSizeInBytes => $composableBuilder(
|
||||
column: $table.quotaSizeInBytes,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<int> get quotaUsageInBytes => $composableBuilder(
|
||||
column: $table.quotaUsageInBytes,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get storageLabel => $composableBuilder(
|
||||
column: $table.storageLabel,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
}
|
||||
|
||||
class $$AuthUserEntityTableOrderingComposer
|
||||
extends i0.Composer<i0.GeneratedDatabase, i1.$AuthUserEntityTable> {
|
||||
$$AuthUserEntityTableOrderingComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
super.joinBuilder,
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
i0.ColumnOrderings<String> get id => $composableBuilder(
|
||||
column: $table.id, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get name => $composableBuilder(
|
||||
column: $table.name, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get email => $composableBuilder(
|
||||
column: $table.email, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
||||
column: $table.deletedAt,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<int> get avatarColor => $composableBuilder(
|
||||
column: $table.avatarColor,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<bool> get isAdmin => $composableBuilder(
|
||||
column: $table.isAdmin, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get oauthId => $composableBuilder(
|
||||
column: $table.oauthId, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get pinCode => $composableBuilder(
|
||||
column: $table.pinCode, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<bool> get hasProfileImage => $composableBuilder(
|
||||
column: $table.hasProfileImage,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<DateTime> get profileChangedAt => $composableBuilder(
|
||||
column: $table.profileChangedAt,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<int> get quotaSizeInBytes => $composableBuilder(
|
||||
column: $table.quotaSizeInBytes,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<int> get quotaUsageInBytes => $composableBuilder(
|
||||
column: $table.quotaUsageInBytes,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get storageLabel => $composableBuilder(
|
||||
column: $table.storageLabel,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
}
|
||||
|
||||
class $$AuthUserEntityTableAnnotationComposer
|
||||
extends i0.Composer<i0.GeneratedDatabase, i1.$AuthUserEntityTable> {
|
||||
$$AuthUserEntityTableAnnotationComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
super.joinBuilder,
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
i0.GeneratedColumn<String> get id =>
|
||||
$composableBuilder(column: $table.id, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get name =>
|
||||
$composableBuilder(column: $table.name, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get email =>
|
||||
$composableBuilder(column: $table.email, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<DateTime> get deletedAt =>
|
||||
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumnWithTypeConverter<i2.AvatarColor?, int> get avatarColor =>
|
||||
$composableBuilder(
|
||||
column: $table.avatarColor, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<bool> get isAdmin =>
|
||||
$composableBuilder(column: $table.isAdmin, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get oauthId =>
|
||||
$composableBuilder(column: $table.oauthId, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get pinCode =>
|
||||
$composableBuilder(column: $table.pinCode, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<bool> get hasProfileImage => $composableBuilder(
|
||||
column: $table.hasProfileImage, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<DateTime> get profileChangedAt => $composableBuilder(
|
||||
column: $table.profileChangedAt, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<int> get quotaSizeInBytes => $composableBuilder(
|
||||
column: $table.quotaSizeInBytes, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<int> get quotaUsageInBytes => $composableBuilder(
|
||||
column: $table.quotaUsageInBytes, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get storageLabel => $composableBuilder(
|
||||
column: $table.storageLabel, 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<String> id = const i0.Value.absent(),
|
||||
i0.Value<String> name = const i0.Value.absent(),
|
||||
i0.Value<String> email = const i0.Value.absent(),
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
|
||||
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
||||
i0.Value<String> oauthId = const i0.Value.absent(),
|
||||
i0.Value<String?> pinCode = const i0.Value.absent(),
|
||||
i0.Value<bool> hasProfileImage = const i0.Value.absent(),
|
||||
i0.Value<DateTime> profileChangedAt = const i0.Value.absent(),
|
||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
||||
i0.Value<String?> storageLabel = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.AuthUserEntityCompanion(
|
||||
id: id,
|
||||
name: name,
|
||||
email: email,
|
||||
deletedAt: deletedAt,
|
||||
avatarColor: avatarColor,
|
||||
isAdmin: isAdmin,
|
||||
oauthId: oauthId,
|
||||
pinCode: pinCode,
|
||||
hasProfileImage: hasProfileImage,
|
||||
profileChangedAt: profileChangedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes,
|
||||
storageLabel: storageLabel,
|
||||
),
|
||||
createCompanionCallback: ({
|
||||
required String id,
|
||||
required String name,
|
||||
required String email,
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
|
||||
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
||||
i0.Value<String> oauthId = const i0.Value.absent(),
|
||||
i0.Value<String?> pinCode = const i0.Value.absent(),
|
||||
i0.Value<bool> hasProfileImage = const i0.Value.absent(),
|
||||
i0.Value<DateTime> profileChangedAt = const i0.Value.absent(),
|
||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
||||
i0.Value<String?> storageLabel = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.AuthUserEntityCompanion.insert(
|
||||
id: id,
|
||||
name: name,
|
||||
email: email,
|
||||
deletedAt: deletedAt,
|
||||
avatarColor: avatarColor,
|
||||
isAdmin: isAdmin,
|
||||
oauthId: oauthId,
|
||||
pinCode: pinCode,
|
||||
hasProfileImage: hasProfileImage,
|
||||
profileChangedAt: profileChangedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes,
|
||||
storageLabel: storageLabel,
|
||||
),
|
||||
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<String> id = i0.GeneratedColumn<String>(
|
||||
'id', aliasedName, false,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const i0.VerificationMeta _nameMeta =
|
||||
const i0.VerificationMeta('name');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
|
||||
'name', aliasedName, false,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const i0.VerificationMeta _emailMeta =
|
||||
const i0.VerificationMeta('email');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> email = i0.GeneratedColumn<String>(
|
||||
'email', aliasedName, false,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const i0.VerificationMeta _deletedAtMeta =
|
||||
const i0.VerificationMeta('deletedAt');
|
||||
@override
|
||||
late final i0.GeneratedColumn<DateTime> deletedAt =
|
||||
i0.GeneratedColumn<DateTime>('deleted_at', aliasedName, true,
|
||||
type: i0.DriftSqlType.dateTime, requiredDuringInsert: false);
|
||||
@override
|
||||
late final i0.GeneratedColumnWithTypeConverter<i2.AvatarColor?, int>
|
||||
avatarColor = i0.GeneratedColumn<int>('avatar_color', aliasedName, true,
|
||||
type: i0.DriftSqlType.int, requiredDuringInsert: false)
|
||||
.withConverter<i2.AvatarColor?>(
|
||||
i1.$AuthUserEntityTable.$converteravatarColorn);
|
||||
static const i0.VerificationMeta _isAdminMeta =
|
||||
const i0.VerificationMeta('isAdmin');
|
||||
@override
|
||||
late final i0.GeneratedColumn<bool> isAdmin = i0.GeneratedColumn<bool>(
|
||||
'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 _oauthIdMeta =
|
||||
const i0.VerificationMeta('oauthId');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> oauthId = i0.GeneratedColumn<String>(
|
||||
'oauth_id', aliasedName, false,
|
||||
type: i0.DriftSqlType.string,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: const i4.Constant(''));
|
||||
static const i0.VerificationMeta _pinCodeMeta =
|
||||
const i0.VerificationMeta('pinCode');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> pinCode = i0.GeneratedColumn<String>(
|
||||
'pin_code', aliasedName, true,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: false);
|
||||
static const i0.VerificationMeta _hasProfileImageMeta =
|
||||
const i0.VerificationMeta('hasProfileImage');
|
||||
@override
|
||||
late final i0.GeneratedColumn<bool> hasProfileImage =
|
||||
i0.GeneratedColumn<bool>('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<DateTime> profileChangedAt =
|
||||
i0.GeneratedColumn<DateTime>('profile_changed_at', aliasedName, false,
|
||||
type: i0.DriftSqlType.dateTime,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: i4.currentDateAndTime);
|
||||
static const i0.VerificationMeta _quotaSizeInBytesMeta =
|
||||
const i0.VerificationMeta('quotaSizeInBytes');
|
||||
@override
|
||||
late final i0.GeneratedColumn<int> quotaSizeInBytes = i0.GeneratedColumn<int>(
|
||||
'quota_size_in_bytes', aliasedName, true,
|
||||
type: i0.DriftSqlType.int, requiredDuringInsert: false);
|
||||
static const i0.VerificationMeta _quotaUsageInBytesMeta =
|
||||
const i0.VerificationMeta('quotaUsageInBytes');
|
||||
@override
|
||||
late final i0.GeneratedColumn<int> quotaUsageInBytes =
|
||||
i0.GeneratedColumn<int>('quota_usage_in_bytes', aliasedName, false,
|
||||
type: i0.DriftSqlType.int,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: const i4.Constant(0));
|
||||
static const i0.VerificationMeta _storageLabelMeta =
|
||||
const i0.VerificationMeta('storageLabel');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> storageLabel =
|
||||
i0.GeneratedColumn<String>('storage_label', aliasedName, true,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: false);
|
||||
@override
|
||||
List<i0.GeneratedColumn> get $columns => [
|
||||
id,
|
||||
name,
|
||||
email,
|
||||
deletedAt,
|
||||
avatarColor,
|
||||
isAdmin,
|
||||
oauthId,
|
||||
pinCode,
|
||||
hasProfileImage,
|
||||
profileChangedAt,
|
||||
quotaSizeInBytes,
|
||||
quotaUsageInBytes,
|
||||
storageLabel
|
||||
];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
@override
|
||||
String get actualTableName => $name;
|
||||
static const String $name = 'auth_user_entity';
|
||||
@override
|
||||
i0.VerificationContext validateIntegrity(
|
||||
i0.Insertable<i1.AuthUserEntityData> 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('deleted_at')) {
|
||||
context.handle(_deletedAtMeta,
|
||||
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta));
|
||||
}
|
||||
if (data.containsKey('is_admin')) {
|
||||
context.handle(_isAdminMeta,
|
||||
isAdmin.isAcceptableOrUnknown(data['is_admin']!, _isAdminMeta));
|
||||
}
|
||||
if (data.containsKey('oauth_id')) {
|
||||
context.handle(_oauthIdMeta,
|
||||
oauthId.isAcceptableOrUnknown(data['oauth_id']!, _oauthIdMeta));
|
||||
}
|
||||
if (data.containsKey('pin_code')) {
|
||||
context.handle(_pinCodeMeta,
|
||||
pinCode.isAcceptableOrUnknown(data['pin_code']!, _pinCodeMeta));
|
||||
}
|
||||
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('storage_label')) {
|
||||
context.handle(
|
||||
_storageLabelMeta,
|
||||
storageLabel.isAcceptableOrUnknown(
|
||||
data['storage_label']!, _storageLabelMeta));
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
@override
|
||||
Set<i0.GeneratedColumn> get $primaryKey => {id};
|
||||
@override
|
||||
i1.AuthUserEntityData map(Map<String, dynamic> 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'])!,
|
||||
deletedAt: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.dateTime, data['${effectivePrefix}deleted_at']),
|
||||
avatarColor: i1.$AuthUserEntityTable.$converteravatarColorn.fromSql(
|
||||
attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.int, data['${effectivePrefix}avatar_color'])),
|
||||
isAdmin: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.bool, data['${effectivePrefix}is_admin'])!,
|
||||
oauthId: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}oauth_id'])!,
|
||||
pinCode: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}pin_code']),
|
||||
hasProfileImage: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.bool, data['${effectivePrefix}has_profile_image'])!,
|
||||
profileChangedAt: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}profile_changed_at'])!,
|
||||
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'])!,
|
||||
storageLabel: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.string, data['${effectivePrefix}storage_label']),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
$AuthUserEntityTable createAlias(String alias) {
|
||||
return $AuthUserEntityTable(attachedDatabase, alias);
|
||||
}
|
||||
|
||||
static i0.JsonTypeConverter2<i2.AvatarColor, int, int> $converteravatarColor =
|
||||
const i0.EnumIndexConverter<i2.AvatarColor>(i2.AvatarColor.values);
|
||||
static i0.JsonTypeConverter2<i2.AvatarColor?, int?, int?>
|
||||
$converteravatarColorn =
|
||||
i0.JsonTypeConverter2.asNullable($converteravatarColor);
|
||||
@override
|
||||
bool get withoutRowId => true;
|
||||
@override
|
||||
bool get isStrict => true;
|
||||
}
|
||||
|
||||
class AuthUserEntityData extends i0.DataClass
|
||||
implements i0.Insertable<i1.AuthUserEntityData> {
|
||||
final String id;
|
||||
final String name;
|
||||
final String email;
|
||||
final DateTime? deletedAt;
|
||||
final i2.AvatarColor? avatarColor;
|
||||
final bool isAdmin;
|
||||
final String oauthId;
|
||||
final String? pinCode;
|
||||
final bool hasProfileImage;
|
||||
final DateTime profileChangedAt;
|
||||
final int? quotaSizeInBytes;
|
||||
final int quotaUsageInBytes;
|
||||
final String? storageLabel;
|
||||
const AuthUserEntityData(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.email,
|
||||
this.deletedAt,
|
||||
this.avatarColor,
|
||||
required this.isAdmin,
|
||||
required this.oauthId,
|
||||
this.pinCode,
|
||||
required this.hasProfileImage,
|
||||
required this.profileChangedAt,
|
||||
this.quotaSizeInBytes,
|
||||
required this.quotaUsageInBytes,
|
||||
this.storageLabel});
|
||||
@override
|
||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, i0.Expression>{};
|
||||
map['id'] = i0.Variable<String>(id);
|
||||
map['name'] = i0.Variable<String>(name);
|
||||
map['email'] = i0.Variable<String>(email);
|
||||
if (!nullToAbsent || deletedAt != null) {
|
||||
map['deleted_at'] = i0.Variable<DateTime>(deletedAt);
|
||||
}
|
||||
if (!nullToAbsent || avatarColor != null) {
|
||||
map['avatar_color'] = i0.Variable<int>(
|
||||
i1.$AuthUserEntityTable.$converteravatarColorn.toSql(avatarColor));
|
||||
}
|
||||
map['is_admin'] = i0.Variable<bool>(isAdmin);
|
||||
map['oauth_id'] = i0.Variable<String>(oauthId);
|
||||
if (!nullToAbsent || pinCode != null) {
|
||||
map['pin_code'] = i0.Variable<String>(pinCode);
|
||||
}
|
||||
map['has_profile_image'] = i0.Variable<bool>(hasProfileImage);
|
||||
map['profile_changed_at'] = i0.Variable<DateTime>(profileChangedAt);
|
||||
if (!nullToAbsent || quotaSizeInBytes != null) {
|
||||
map['quota_size_in_bytes'] = i0.Variable<int>(quotaSizeInBytes);
|
||||
}
|
||||
map['quota_usage_in_bytes'] = i0.Variable<int>(quotaUsageInBytes);
|
||||
if (!nullToAbsent || storageLabel != null) {
|
||||
map['storage_label'] = i0.Variable<String>(storageLabel);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
factory AuthUserEntityData.fromJson(Map<String, dynamic> json,
|
||||
{i0.ValueSerializer? serializer}) {
|
||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||
return AuthUserEntityData(
|
||||
id: serializer.fromJson<String>(json['id']),
|
||||
name: serializer.fromJson<String>(json['name']),
|
||||
email: serializer.fromJson<String>(json['email']),
|
||||
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
||||
avatarColor: i1.$AuthUserEntityTable.$converteravatarColorn
|
||||
.fromJson(serializer.fromJson<int?>(json['avatarColor'])),
|
||||
isAdmin: serializer.fromJson<bool>(json['isAdmin']),
|
||||
oauthId: serializer.fromJson<String>(json['oauthId']),
|
||||
pinCode: serializer.fromJson<String?>(json['pinCode']),
|
||||
hasProfileImage: serializer.fromJson<bool>(json['hasProfileImage']),
|
||||
profileChangedAt: serializer.fromJson<DateTime>(json['profileChangedAt']),
|
||||
quotaSizeInBytes: serializer.fromJson<int?>(json['quotaSizeInBytes']),
|
||||
quotaUsageInBytes: serializer.fromJson<int>(json['quotaUsageInBytes']),
|
||||
storageLabel: serializer.fromJson<String?>(json['storageLabel']),
|
||||
);
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toJson({i0.ValueSerializer? serializer}) {
|
||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||
return <String, dynamic>{
|
||||
'id': serializer.toJson<String>(id),
|
||||
'name': serializer.toJson<String>(name),
|
||||
'email': serializer.toJson<String>(email),
|
||||
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
||||
'avatarColor': serializer.toJson<int?>(
|
||||
i1.$AuthUserEntityTable.$converteravatarColorn.toJson(avatarColor)),
|
||||
'isAdmin': serializer.toJson<bool>(isAdmin),
|
||||
'oauthId': serializer.toJson<String>(oauthId),
|
||||
'pinCode': serializer.toJson<String?>(pinCode),
|
||||
'hasProfileImage': serializer.toJson<bool>(hasProfileImage),
|
||||
'profileChangedAt': serializer.toJson<DateTime>(profileChangedAt),
|
||||
'quotaSizeInBytes': serializer.toJson<int?>(quotaSizeInBytes),
|
||||
'quotaUsageInBytes': serializer.toJson<int>(quotaUsageInBytes),
|
||||
'storageLabel': serializer.toJson<String?>(storageLabel),
|
||||
};
|
||||
}
|
||||
|
||||
i1.AuthUserEntityData copyWith(
|
||||
{String? id,
|
||||
String? name,
|
||||
String? email,
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
|
||||
bool? isAdmin,
|
||||
String? oauthId,
|
||||
i0.Value<String?> pinCode = const i0.Value.absent(),
|
||||
bool? hasProfileImage,
|
||||
DateTime? profileChangedAt,
|
||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||
int? quotaUsageInBytes,
|
||||
i0.Value<String?> storageLabel = const i0.Value.absent()}) =>
|
||||
i1.AuthUserEntityData(
|
||||
id: id ?? this.id,
|
||||
name: name ?? this.name,
|
||||
email: email ?? this.email,
|
||||
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
||||
avatarColor: avatarColor.present ? avatarColor.value : this.avatarColor,
|
||||
isAdmin: isAdmin ?? this.isAdmin,
|
||||
oauthId: oauthId ?? this.oauthId,
|
||||
pinCode: pinCode.present ? pinCode.value : this.pinCode,
|
||||
hasProfileImage: hasProfileImage ?? this.hasProfileImage,
|
||||
profileChangedAt: profileChangedAt ?? this.profileChangedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes.present
|
||||
? quotaSizeInBytes.value
|
||||
: this.quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
|
||||
storageLabel:
|
||||
storageLabel.present ? storageLabel.value : this.storageLabel,
|
||||
);
|
||||
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,
|
||||
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
||||
avatarColor:
|
||||
data.avatarColor.present ? data.avatarColor.value : this.avatarColor,
|
||||
isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin,
|
||||
oauthId: data.oauthId.present ? data.oauthId.value : this.oauthId,
|
||||
pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode,
|
||||
hasProfileImage: data.hasProfileImage.present
|
||||
? data.hasProfileImage.value
|
||||
: this.hasProfileImage,
|
||||
profileChangedAt: data.profileChangedAt.present
|
||||
? data.profileChangedAt.value
|
||||
: this.profileChangedAt,
|
||||
quotaSizeInBytes: data.quotaSizeInBytes.present
|
||||
? data.quotaSizeInBytes.value
|
||||
: this.quotaSizeInBytes,
|
||||
quotaUsageInBytes: data.quotaUsageInBytes.present
|
||||
? data.quotaUsageInBytes.value
|
||||
: this.quotaUsageInBytes,
|
||||
storageLabel: data.storageLabel.present
|
||||
? data.storageLabel.value
|
||||
: this.storageLabel,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (StringBuffer('AuthUserEntityData(')
|
||||
..write('id: $id, ')
|
||||
..write('name: $name, ')
|
||||
..write('email: $email, ')
|
||||
..write('deletedAt: $deletedAt, ')
|
||||
..write('avatarColor: $avatarColor, ')
|
||||
..write('isAdmin: $isAdmin, ')
|
||||
..write('oauthId: $oauthId, ')
|
||||
..write('pinCode: $pinCode, ')
|
||||
..write('hasProfileImage: $hasProfileImage, ')
|
||||
..write('profileChangedAt: $profileChangedAt, ')
|
||||
..write('quotaSizeInBytes: $quotaSizeInBytes, ')
|
||||
..write('quotaUsageInBytes: $quotaUsageInBytes, ')
|
||||
..write('storageLabel: $storageLabel')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
id,
|
||||
name,
|
||||
email,
|
||||
deletedAt,
|
||||
avatarColor,
|
||||
isAdmin,
|
||||
oauthId,
|
||||
pinCode,
|
||||
hasProfileImage,
|
||||
profileChangedAt,
|
||||
quotaSizeInBytes,
|
||||
quotaUsageInBytes,
|
||||
storageLabel);
|
||||
@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.deletedAt == this.deletedAt &&
|
||||
other.avatarColor == this.avatarColor &&
|
||||
other.isAdmin == this.isAdmin &&
|
||||
other.oauthId == this.oauthId &&
|
||||
other.pinCode == this.pinCode &&
|
||||
other.hasProfileImage == this.hasProfileImage &&
|
||||
other.profileChangedAt == this.profileChangedAt &&
|
||||
other.quotaSizeInBytes == this.quotaSizeInBytes &&
|
||||
other.quotaUsageInBytes == this.quotaUsageInBytes &&
|
||||
other.storageLabel == this.storageLabel);
|
||||
}
|
||||
|
||||
class AuthUserEntityCompanion
|
||||
extends i0.UpdateCompanion<i1.AuthUserEntityData> {
|
||||
final i0.Value<String> id;
|
||||
final i0.Value<String> name;
|
||||
final i0.Value<String> email;
|
||||
final i0.Value<DateTime?> deletedAt;
|
||||
final i0.Value<i2.AvatarColor?> avatarColor;
|
||||
final i0.Value<bool> isAdmin;
|
||||
final i0.Value<String> oauthId;
|
||||
final i0.Value<String?> pinCode;
|
||||
final i0.Value<bool> hasProfileImage;
|
||||
final i0.Value<DateTime> profileChangedAt;
|
||||
final i0.Value<int?> quotaSizeInBytes;
|
||||
final i0.Value<int> quotaUsageInBytes;
|
||||
final i0.Value<String?> storageLabel;
|
||||
const AuthUserEntityCompanion({
|
||||
this.id = const i0.Value.absent(),
|
||||
this.name = const i0.Value.absent(),
|
||||
this.email = const i0.Value.absent(),
|
||||
this.deletedAt = const i0.Value.absent(),
|
||||
this.avatarColor = const i0.Value.absent(),
|
||||
this.isAdmin = const i0.Value.absent(),
|
||||
this.oauthId = const i0.Value.absent(),
|
||||
this.pinCode = const i0.Value.absent(),
|
||||
this.hasProfileImage = const i0.Value.absent(),
|
||||
this.profileChangedAt = const i0.Value.absent(),
|
||||
this.quotaSizeInBytes = const i0.Value.absent(),
|
||||
this.quotaUsageInBytes = const i0.Value.absent(),
|
||||
this.storageLabel = const i0.Value.absent(),
|
||||
});
|
||||
AuthUserEntityCompanion.insert({
|
||||
required String id,
|
||||
required String name,
|
||||
required String email,
|
||||
this.deletedAt = const i0.Value.absent(),
|
||||
this.avatarColor = const i0.Value.absent(),
|
||||
this.isAdmin = const i0.Value.absent(),
|
||||
this.oauthId = const i0.Value.absent(),
|
||||
this.pinCode = const i0.Value.absent(),
|
||||
this.hasProfileImage = const i0.Value.absent(),
|
||||
this.profileChangedAt = const i0.Value.absent(),
|
||||
this.quotaSizeInBytes = const i0.Value.absent(),
|
||||
this.quotaUsageInBytes = const i0.Value.absent(),
|
||||
this.storageLabel = const i0.Value.absent(),
|
||||
}) : id = i0.Value(id),
|
||||
name = i0.Value(name),
|
||||
email = i0.Value(email);
|
||||
static i0.Insertable<i1.AuthUserEntityData> custom({
|
||||
i0.Expression<String>? id,
|
||||
i0.Expression<String>? name,
|
||||
i0.Expression<String>? email,
|
||||
i0.Expression<DateTime>? deletedAt,
|
||||
i0.Expression<int>? avatarColor,
|
||||
i0.Expression<bool>? isAdmin,
|
||||
i0.Expression<String>? oauthId,
|
||||
i0.Expression<String>? pinCode,
|
||||
i0.Expression<bool>? hasProfileImage,
|
||||
i0.Expression<DateTime>? profileChangedAt,
|
||||
i0.Expression<int>? quotaSizeInBytes,
|
||||
i0.Expression<int>? quotaUsageInBytes,
|
||||
i0.Expression<String>? storageLabel,
|
||||
}) {
|
||||
return i0.RawValuesInsertable({
|
||||
if (id != null) 'id': id,
|
||||
if (name != null) 'name': name,
|
||||
if (email != null) 'email': email,
|
||||
if (deletedAt != null) 'deleted_at': deletedAt,
|
||||
if (avatarColor != null) 'avatar_color': avatarColor,
|
||||
if (isAdmin != null) 'is_admin': isAdmin,
|
||||
if (oauthId != null) 'oauth_id': oauthId,
|
||||
if (pinCode != null) 'pin_code': pinCode,
|
||||
if (hasProfileImage != null) 'has_profile_image': hasProfileImage,
|
||||
if (profileChangedAt != null) 'profile_changed_at': profileChangedAt,
|
||||
if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes,
|
||||
if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes,
|
||||
if (storageLabel != null) 'storage_label': storageLabel,
|
||||
});
|
||||
}
|
||||
|
||||
i1.AuthUserEntityCompanion copyWith(
|
||||
{i0.Value<String>? id,
|
||||
i0.Value<String>? name,
|
||||
i0.Value<String>? email,
|
||||
i0.Value<DateTime?>? deletedAt,
|
||||
i0.Value<i2.AvatarColor?>? avatarColor,
|
||||
i0.Value<bool>? isAdmin,
|
||||
i0.Value<String>? oauthId,
|
||||
i0.Value<String?>? pinCode,
|
||||
i0.Value<bool>? hasProfileImage,
|
||||
i0.Value<DateTime>? profileChangedAt,
|
||||
i0.Value<int?>? quotaSizeInBytes,
|
||||
i0.Value<int>? quotaUsageInBytes,
|
||||
i0.Value<String?>? storageLabel}) {
|
||||
return i1.AuthUserEntityCompanion(
|
||||
id: id ?? this.id,
|
||||
name: name ?? this.name,
|
||||
email: email ?? this.email,
|
||||
deletedAt: deletedAt ?? this.deletedAt,
|
||||
avatarColor: avatarColor ?? this.avatarColor,
|
||||
isAdmin: isAdmin ?? this.isAdmin,
|
||||
oauthId: oauthId ?? this.oauthId,
|
||||
pinCode: pinCode ?? this.pinCode,
|
||||
hasProfileImage: hasProfileImage ?? this.hasProfileImage,
|
||||
profileChangedAt: profileChangedAt ?? this.profileChangedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
|
||||
storageLabel: storageLabel ?? this.storageLabel,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, i0.Expression>{};
|
||||
if (id.present) {
|
||||
map['id'] = i0.Variable<String>(id.value);
|
||||
}
|
||||
if (name.present) {
|
||||
map['name'] = i0.Variable<String>(name.value);
|
||||
}
|
||||
if (email.present) {
|
||||
map['email'] = i0.Variable<String>(email.value);
|
||||
}
|
||||
if (deletedAt.present) {
|
||||
map['deleted_at'] = i0.Variable<DateTime>(deletedAt.value);
|
||||
}
|
||||
if (avatarColor.present) {
|
||||
map['avatar_color'] = i0.Variable<int>(i1
|
||||
.$AuthUserEntityTable.$converteravatarColorn
|
||||
.toSql(avatarColor.value));
|
||||
}
|
||||
if (isAdmin.present) {
|
||||
map['is_admin'] = i0.Variable<bool>(isAdmin.value);
|
||||
}
|
||||
if (oauthId.present) {
|
||||
map['oauth_id'] = i0.Variable<String>(oauthId.value);
|
||||
}
|
||||
if (pinCode.present) {
|
||||
map['pin_code'] = i0.Variable<String>(pinCode.value);
|
||||
}
|
||||
if (hasProfileImage.present) {
|
||||
map['has_profile_image'] = i0.Variable<bool>(hasProfileImage.value);
|
||||
}
|
||||
if (profileChangedAt.present) {
|
||||
map['profile_changed_at'] = i0.Variable<DateTime>(profileChangedAt.value);
|
||||
}
|
||||
if (quotaSizeInBytes.present) {
|
||||
map['quota_size_in_bytes'] = i0.Variable<int>(quotaSizeInBytes.value);
|
||||
}
|
||||
if (quotaUsageInBytes.present) {
|
||||
map['quota_usage_in_bytes'] = i0.Variable<int>(quotaUsageInBytes.value);
|
||||
}
|
||||
if (storageLabel.present) {
|
||||
map['storage_label'] = i0.Variable<String>(storageLabel.value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (StringBuffer('AuthUserEntityCompanion(')
|
||||
..write('id: $id, ')
|
||||
..write('name: $name, ')
|
||||
..write('email: $email, ')
|
||||
..write('deletedAt: $deletedAt, ')
|
||||
..write('avatarColor: $avatarColor, ')
|
||||
..write('isAdmin: $isAdmin, ')
|
||||
..write('oauthId: $oauthId, ')
|
||||
..write('pinCode: $pinCode, ')
|
||||
..write('hasProfileImage: $hasProfileImage, ')
|
||||
..write('profileChangedAt: $profileChangedAt, ')
|
||||
..write('quotaSizeInBytes: $quotaSizeInBytes, ')
|
||||
..write('quotaUsageInBytes: $quotaUsageInBytes, ')
|
||||
..write('storageLabel: $storageLabel')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
import 'package:drift/drift.dart' hide Index;
|
||||
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||
import 'package:immich_mobile/domain/models/user_metadata.model.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
||||
import 'package:immich_mobile/utils/hash.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
|
||||
part 'user.entity.g.dart';
|
||||
|
||||
// TODO: Remove User once Isar is removed
|
||||
@Collection(inheritance: false)
|
||||
class User {
|
||||
class IsarUser {
|
||||
Id get isarId => fastHash(id);
|
||||
@Index(unique: true, replace: false, type: IndexType.hash)
|
||||
final String id;
|
||||
@@ -26,7 +28,7 @@ class User {
|
||||
final int quotaUsageInBytes;
|
||||
final int quotaSizeInBytes;
|
||||
|
||||
const User({
|
||||
const IsarUser({
|
||||
required this.id,
|
||||
required this.updatedAt,
|
||||
required this.email,
|
||||
@@ -42,7 +44,7 @@ class User {
|
||||
this.quotaSizeInBytes = 0,
|
||||
});
|
||||
|
||||
static User fromDto(UserDto dto) => User(
|
||||
static IsarUser fromDto(UserDto dto) => IsarUser(
|
||||
id: dto.id,
|
||||
updatedAt: dto.updatedAt,
|
||||
email: dto.email,
|
||||
@@ -79,15 +81,25 @@ class UserEntity extends Table with DriftDefaultsMixin {
|
||||
const UserEntity();
|
||||
|
||||
TextColumn get id => text()();
|
||||
|
||||
TextColumn get name => text()();
|
||||
BoolColumn get isAdmin => boolean().withDefault(const Constant(false))();
|
||||
|
||||
TextColumn get email => text()();
|
||||
TextColumn get profileImagePath => text().nullable()();
|
||||
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
||||
// Quota
|
||||
IntColumn get quotaSizeInBytes => integer().nullable()();
|
||||
IntColumn get quotaUsageInBytes => integer().withDefault(const Constant(0))();
|
||||
|
||||
DateTimeColumn get deletedAt => dateTime().nullable()();
|
||||
|
||||
IntColumn get avatarColor => intEnum<AvatarColor>().nullable()();
|
||||
|
||||
@override
|
||||
Set<Column> get primaryKey => {id};
|
||||
}
|
||||
|
||||
extension UserEntityDataDomainEx on UserEntityData {
|
||||
User toDto() => User(
|
||||
id: id,
|
||||
name: name,
|
||||
email: email,
|
||||
deletedAt: deletedAt,
|
||||
avatarColor: avatarColor,
|
||||
);
|
||||
}
|
||||
|
||||
+103
-275
@@ -3,30 +3,24 @@
|
||||
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/user.entity.dart' as i2;
|
||||
import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3;
|
||||
import 'package:immich_mobile/domain/models/user_metadata.model.dart' as i2;
|
||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart' as i3;
|
||||
|
||||
typedef $$UserEntityTableCreateCompanionBuilder = i1.UserEntityCompanion
|
||||
Function({
|
||||
required String id,
|
||||
required String name,
|
||||
i0.Value<bool> isAdmin,
|
||||
required String email,
|
||||
i0.Value<String?> profileImagePath,
|
||||
i0.Value<DateTime> updatedAt,
|
||||
i0.Value<int?> quotaSizeInBytes,
|
||||
i0.Value<int> quotaUsageInBytes,
|
||||
i0.Value<DateTime?> deletedAt,
|
||||
i0.Value<i2.AvatarColor?> avatarColor,
|
||||
});
|
||||
typedef $$UserEntityTableUpdateCompanionBuilder = i1.UserEntityCompanion
|
||||
Function({
|
||||
i0.Value<String> id,
|
||||
i0.Value<String> name,
|
||||
i0.Value<bool> isAdmin,
|
||||
i0.Value<String> email,
|
||||
i0.Value<String?> profileImagePath,
|
||||
i0.Value<DateTime> updatedAt,
|
||||
i0.Value<int?> quotaSizeInBytes,
|
||||
i0.Value<int> quotaUsageInBytes,
|
||||
i0.Value<DateTime?> deletedAt,
|
||||
i0.Value<i2.AvatarColor?> avatarColor,
|
||||
});
|
||||
|
||||
class $$UserEntityTableFilterComposer
|
||||
@@ -44,26 +38,16 @@ class $$UserEntityTableFilterComposer
|
||||
i0.ColumnFilters<String> get name => $composableBuilder(
|
||||
column: $table.name, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<bool> get isAdmin => $composableBuilder(
|
||||
column: $table.isAdmin, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get email => $composableBuilder(
|
||||
column: $table.email, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get profileImagePath => $composableBuilder(
|
||||
column: $table.profileImagePath,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
i0.ColumnFilters<DateTime> get deletedAt => $composableBuilder(
|
||||
column: $table.deletedAt, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
||||
column: $table.updatedAt, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<int> get quotaSizeInBytes => $composableBuilder(
|
||||
column: $table.quotaSizeInBytes,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i0.ColumnFilters<int> get quotaUsageInBytes => $composableBuilder(
|
||||
column: $table.quotaUsageInBytes,
|
||||
builder: (column) => i0.ColumnFilters(column));
|
||||
i0.ColumnWithTypeConverterFilters<i2.AvatarColor?, i2.AvatarColor, int>
|
||||
get avatarColor => $composableBuilder(
|
||||
column: $table.avatarColor,
|
||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
||||
}
|
||||
|
||||
class $$UserEntityTableOrderingComposer
|
||||
@@ -81,26 +65,15 @@ class $$UserEntityTableOrderingComposer
|
||||
i0.ColumnOrderings<String> get name => $composableBuilder(
|
||||
column: $table.name, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<bool> get isAdmin => $composableBuilder(
|
||||
column: $table.isAdmin, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get email => $composableBuilder(
|
||||
column: $table.email, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get profileImagePath => $composableBuilder(
|
||||
column: $table.profileImagePath,
|
||||
i0.ColumnOrderings<DateTime> get deletedAt => $composableBuilder(
|
||||
column: $table.deletedAt,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
||||
column: $table.updatedAt,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<int> get quotaSizeInBytes => $composableBuilder(
|
||||
column: $table.quotaSizeInBytes,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<int> get quotaUsageInBytes => $composableBuilder(
|
||||
column: $table.quotaUsageInBytes,
|
||||
i0.ColumnOrderings<int> get avatarColor => $composableBuilder(
|
||||
column: $table.avatarColor,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
}
|
||||
|
||||
@@ -119,23 +92,15 @@ class $$UserEntityTableAnnotationComposer
|
||||
i0.GeneratedColumn<String> get name =>
|
||||
$composableBuilder(column: $table.name, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<bool> get isAdmin =>
|
||||
$composableBuilder(column: $table.isAdmin, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get email =>
|
||||
$composableBuilder(column: $table.email, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get profileImagePath => $composableBuilder(
|
||||
column: $table.profileImagePath, builder: (column) => column);
|
||||
i0.GeneratedColumn<DateTime> get deletedAt =>
|
||||
$composableBuilder(column: $table.deletedAt, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<DateTime> get updatedAt =>
|
||||
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<int> get quotaSizeInBytes => $composableBuilder(
|
||||
column: $table.quotaSizeInBytes, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<int> get quotaUsageInBytes => $composableBuilder(
|
||||
column: $table.quotaUsageInBytes, builder: (column) => column);
|
||||
i0.GeneratedColumnWithTypeConverter<i2.AvatarColor?, int> get avatarColor =>
|
||||
$composableBuilder(
|
||||
column: $table.avatarColor, builder: (column) => column);
|
||||
}
|
||||
|
||||
class $$UserEntityTableTableManager extends i0.RootTableManager<
|
||||
@@ -168,42 +133,30 @@ class $$UserEntityTableTableManager extends i0.RootTableManager<
|
||||
updateCompanionCallback: ({
|
||||
i0.Value<String> id = const i0.Value.absent(),
|
||||
i0.Value<String> name = const i0.Value.absent(),
|
||||
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
||||
i0.Value<String> email = const i0.Value.absent(),
|
||||
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.UserEntityCompanion(
|
||||
id: id,
|
||||
name: name,
|
||||
isAdmin: isAdmin,
|
||||
email: email,
|
||||
profileImagePath: profileImagePath,
|
||||
updatedAt: updatedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes,
|
||||
deletedAt: deletedAt,
|
||||
avatarColor: avatarColor,
|
||||
),
|
||||
createCompanionCallback: ({
|
||||
required String id,
|
||||
required String name,
|
||||
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
||||
required String email,
|
||||
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.UserEntityCompanion.insert(
|
||||
id: id,
|
||||
name: name,
|
||||
isAdmin: isAdmin,
|
||||
email: email,
|
||||
profileImagePath: profileImagePath,
|
||||
updatedAt: updatedAt,
|
||||
quotaSizeInBytes: quotaSizeInBytes,
|
||||
quotaUsageInBytes: quotaUsageInBytes,
|
||||
deletedAt: deletedAt,
|
||||
avatarColor: avatarColor,
|
||||
),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
|
||||
@@ -229,7 +182,7 @@ typedef $$UserEntityTableProcessedTableManager = i0.ProcessedTableManager<
|
||||
i1.UserEntityData,
|
||||
i0.PrefetchHooks Function()>;
|
||||
|
||||
class $UserEntityTable extends i2.UserEntity
|
||||
class $UserEntityTable extends i3.UserEntity
|
||||
with i0.TableInfo<$UserEntityTable, i1.UserEntityData> {
|
||||
@override
|
||||
final i0.GeneratedDatabase attachedDatabase;
|
||||
@@ -246,61 +199,27 @@ class $UserEntityTable extends i2.UserEntity
|
||||
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
|
||||
'name', aliasedName, false,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const i0.VerificationMeta _isAdminMeta =
|
||||
const i0.VerificationMeta('isAdmin');
|
||||
@override
|
||||
late final i0.GeneratedColumn<bool> isAdmin = i0.GeneratedColumn<bool>(
|
||||
'is_admin', aliasedName, false,
|
||||
type: i0.DriftSqlType.bool,
|
||||
requiredDuringInsert: false,
|
||||
defaultConstraints:
|
||||
i0.GeneratedColumn.constraintIsAlways('CHECK ("is_admin" IN (0, 1))'),
|
||||
defaultValue: const i3.Constant(false));
|
||||
static const i0.VerificationMeta _emailMeta =
|
||||
const i0.VerificationMeta('email');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> email = i0.GeneratedColumn<String>(
|
||||
'email', aliasedName, false,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const i0.VerificationMeta _profileImagePathMeta =
|
||||
const i0.VerificationMeta('profileImagePath');
|
||||
static const i0.VerificationMeta _deletedAtMeta =
|
||||
const i0.VerificationMeta('deletedAt');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> profileImagePath =
|
||||
i0.GeneratedColumn<String>('profile_image_path', aliasedName, true,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: false);
|
||||
static const i0.VerificationMeta _updatedAtMeta =
|
||||
const i0.VerificationMeta('updatedAt');
|
||||
late final i0.GeneratedColumn<DateTime> deletedAt =
|
||||
i0.GeneratedColumn<DateTime>('deleted_at', aliasedName, true,
|
||||
type: i0.DriftSqlType.dateTime, requiredDuringInsert: false);
|
||||
@override
|
||||
late final i0.GeneratedColumn<DateTime> updatedAt =
|
||||
i0.GeneratedColumn<DateTime>('updated_at', aliasedName, false,
|
||||
type: i0.DriftSqlType.dateTime,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: i3.currentDateAndTime);
|
||||
static const i0.VerificationMeta _quotaSizeInBytesMeta =
|
||||
const i0.VerificationMeta('quotaSizeInBytes');
|
||||
late final i0.GeneratedColumnWithTypeConverter<i2.AvatarColor?, int>
|
||||
avatarColor = i0.GeneratedColumn<int>('avatar_color', aliasedName, true,
|
||||
type: i0.DriftSqlType.int, requiredDuringInsert: false)
|
||||
.withConverter<i2.AvatarColor?>(
|
||||
i1.$UserEntityTable.$converteravatarColorn);
|
||||
@override
|
||||
late final i0.GeneratedColumn<int> quotaSizeInBytes = i0.GeneratedColumn<int>(
|
||||
'quota_size_in_bytes', aliasedName, true,
|
||||
type: i0.DriftSqlType.int, requiredDuringInsert: false);
|
||||
static const i0.VerificationMeta _quotaUsageInBytesMeta =
|
||||
const i0.VerificationMeta('quotaUsageInBytes');
|
||||
@override
|
||||
late final i0.GeneratedColumn<int> quotaUsageInBytes =
|
||||
i0.GeneratedColumn<int>('quota_usage_in_bytes', aliasedName, false,
|
||||
type: i0.DriftSqlType.int,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: const i3.Constant(0));
|
||||
@override
|
||||
List<i0.GeneratedColumn> get $columns => [
|
||||
id,
|
||||
name,
|
||||
isAdmin,
|
||||
email,
|
||||
profileImagePath,
|
||||
updatedAt,
|
||||
quotaSizeInBytes,
|
||||
quotaUsageInBytes
|
||||
];
|
||||
List<i0.GeneratedColumn> get $columns =>
|
||||
[id, name, email, deletedAt, avatarColor];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
@override
|
||||
@@ -323,37 +242,15 @@ class $UserEntityTable extends i2.UserEntity
|
||||
} else if (isInserting) {
|
||||
context.missing(_nameMeta);
|
||||
}
|
||||
if (data.containsKey('is_admin')) {
|
||||
context.handle(_isAdminMeta,
|
||||
isAdmin.isAcceptableOrUnknown(data['is_admin']!, _isAdminMeta));
|
||||
}
|
||||
if (data.containsKey('email')) {
|
||||
context.handle(
|
||||
_emailMeta, email.isAcceptableOrUnknown(data['email']!, _emailMeta));
|
||||
} else if (isInserting) {
|
||||
context.missing(_emailMeta);
|
||||
}
|
||||
if (data.containsKey('profile_image_path')) {
|
||||
context.handle(
|
||||
_profileImagePathMeta,
|
||||
profileImagePath.isAcceptableOrUnknown(
|
||||
data['profile_image_path']!, _profileImagePathMeta));
|
||||
}
|
||||
if (data.containsKey('updated_at')) {
|
||||
context.handle(_updatedAtMeta,
|
||||
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta));
|
||||
}
|
||||
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('deleted_at')) {
|
||||
context.handle(_deletedAtMeta,
|
||||
deletedAt.isAcceptableOrUnknown(data['deleted_at']!, _deletedAtMeta));
|
||||
}
|
||||
return context;
|
||||
}
|
||||
@@ -368,18 +265,13 @@ class $UserEntityTable extends i2.UserEntity
|
||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}id'])!,
|
||||
name: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}name'])!,
|
||||
isAdmin: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.bool, data['${effectivePrefix}is_admin'])!,
|
||||
email: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}email'])!,
|
||||
profileImagePath: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.string, data['${effectivePrefix}profile_image_path']),
|
||||
updatedAt: attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!,
|
||||
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'])!,
|
||||
deletedAt: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.dateTime, data['${effectivePrefix}deleted_at']),
|
||||
avatarColor: i1.$UserEntityTable.$converteravatarColorn.fromSql(
|
||||
attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.int, data['${effectivePrefix}avatar_color'])),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -388,6 +280,11 @@ class $UserEntityTable extends i2.UserEntity
|
||||
return $UserEntityTable(attachedDatabase, alias);
|
||||
}
|
||||
|
||||
static i0.JsonTypeConverter2<i2.AvatarColor, int, int> $converteravatarColor =
|
||||
const i0.EnumIndexConverter<i2.AvatarColor>(i2.AvatarColor.values);
|
||||
static i0.JsonTypeConverter2<i2.AvatarColor?, int?, int?>
|
||||
$converteravatarColorn =
|
||||
i0.JsonTypeConverter2.asNullable($converteravatarColor);
|
||||
@override
|
||||
bool get withoutRowId => true;
|
||||
@override
|
||||
@@ -398,36 +295,28 @@ class UserEntityData extends i0.DataClass
|
||||
implements i0.Insertable<i1.UserEntityData> {
|
||||
final String id;
|
||||
final String name;
|
||||
final bool isAdmin;
|
||||
final String email;
|
||||
final String? profileImagePath;
|
||||
final DateTime updatedAt;
|
||||
final int? quotaSizeInBytes;
|
||||
final int quotaUsageInBytes;
|
||||
final DateTime? deletedAt;
|
||||
final i2.AvatarColor? avatarColor;
|
||||
const UserEntityData(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.isAdmin,
|
||||
required this.email,
|
||||
this.profileImagePath,
|
||||
required this.updatedAt,
|
||||
this.quotaSizeInBytes,
|
||||
required this.quotaUsageInBytes});
|
||||
this.deletedAt,
|
||||
this.avatarColor});
|
||||
@override
|
||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, i0.Expression>{};
|
||||
map['id'] = i0.Variable<String>(id);
|
||||
map['name'] = i0.Variable<String>(name);
|
||||
map['is_admin'] = i0.Variable<bool>(isAdmin);
|
||||
map['email'] = i0.Variable<String>(email);
|
||||
if (!nullToAbsent || profileImagePath != null) {
|
||||
map['profile_image_path'] = i0.Variable<String>(profileImagePath);
|
||||
if (!nullToAbsent || deletedAt != null) {
|
||||
map['deleted_at'] = i0.Variable<DateTime>(deletedAt);
|
||||
}
|
||||
map['updated_at'] = i0.Variable<DateTime>(updatedAt);
|
||||
if (!nullToAbsent || quotaSizeInBytes != null) {
|
||||
map['quota_size_in_bytes'] = i0.Variable<int>(quotaSizeInBytes);
|
||||
if (!nullToAbsent || avatarColor != null) {
|
||||
map['avatar_color'] = i0.Variable<int>(
|
||||
i1.$UserEntityTable.$converteravatarColorn.toSql(avatarColor));
|
||||
}
|
||||
map['quota_usage_in_bytes'] = i0.Variable<int>(quotaUsageInBytes);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -437,12 +326,10 @@ class UserEntityData extends i0.DataClass
|
||||
return UserEntityData(
|
||||
id: serializer.fromJson<String>(json['id']),
|
||||
name: serializer.fromJson<String>(json['name']),
|
||||
isAdmin: serializer.fromJson<bool>(json['isAdmin']),
|
||||
email: serializer.fromJson<String>(json['email']),
|
||||
profileImagePath: serializer.fromJson<String?>(json['profileImagePath']),
|
||||
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
||||
quotaSizeInBytes: serializer.fromJson<int?>(json['quotaSizeInBytes']),
|
||||
quotaUsageInBytes: serializer.fromJson<int>(json['quotaUsageInBytes']),
|
||||
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
||||
avatarColor: i1.$UserEntityTable.$converteravatarColorn
|
||||
.fromJson(serializer.fromJson<int?>(json['avatarColor'])),
|
||||
);
|
||||
}
|
||||
@override
|
||||
@@ -451,54 +338,34 @@ class UserEntityData extends i0.DataClass
|
||||
return <String, dynamic>{
|
||||
'id': serializer.toJson<String>(id),
|
||||
'name': serializer.toJson<String>(name),
|
||||
'isAdmin': serializer.toJson<bool>(isAdmin),
|
||||
'email': serializer.toJson<String>(email),
|
||||
'profileImagePath': serializer.toJson<String?>(profileImagePath),
|
||||
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
||||
'quotaSizeInBytes': serializer.toJson<int?>(quotaSizeInBytes),
|
||||
'quotaUsageInBytes': serializer.toJson<int>(quotaUsageInBytes),
|
||||
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
||||
'avatarColor': serializer.toJson<int?>(
|
||||
i1.$UserEntityTable.$converteravatarColorn.toJson(avatarColor)),
|
||||
};
|
||||
}
|
||||
|
||||
i1.UserEntityData copyWith(
|
||||
{String? id,
|
||||
String? name,
|
||||
bool? isAdmin,
|
||||
String? email,
|
||||
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
||||
DateTime? updatedAt,
|
||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||
int? quotaUsageInBytes}) =>
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<i2.AvatarColor?> avatarColor = const i0.Value.absent()}) =>
|
||||
i1.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,
|
||||
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
||||
avatarColor: avatarColor.present ? avatarColor.value : 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,
|
||||
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,
|
||||
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
||||
avatarColor:
|
||||
data.avatarColor.present ? data.avatarColor.value : this.avatarColor,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -507,104 +374,76 @@ class UserEntityData extends i0.DataClass
|
||||
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('deletedAt: $deletedAt, ')
|
||||
..write('avatarColor: $avatarColor')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(id, name, isAdmin, email, profileImagePath,
|
||||
updatedAt, quotaSizeInBytes, quotaUsageInBytes);
|
||||
int get hashCode => Object.hash(id, name, email, deletedAt, avatarColor);
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
(other is i1.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);
|
||||
other.deletedAt == this.deletedAt &&
|
||||
other.avatarColor == this.avatarColor);
|
||||
}
|
||||
|
||||
class UserEntityCompanion extends i0.UpdateCompanion<i1.UserEntityData> {
|
||||
final i0.Value<String> id;
|
||||
final i0.Value<String> name;
|
||||
final i0.Value<bool> isAdmin;
|
||||
final i0.Value<String> email;
|
||||
final i0.Value<String?> profileImagePath;
|
||||
final i0.Value<DateTime> updatedAt;
|
||||
final i0.Value<int?> quotaSizeInBytes;
|
||||
final i0.Value<int> quotaUsageInBytes;
|
||||
final i0.Value<DateTime?> deletedAt;
|
||||
final i0.Value<i2.AvatarColor?> avatarColor;
|
||||
const UserEntityCompanion({
|
||||
this.id = const i0.Value.absent(),
|
||||
this.name = const i0.Value.absent(),
|
||||
this.isAdmin = const i0.Value.absent(),
|
||||
this.email = const i0.Value.absent(),
|
||||
this.profileImagePath = const i0.Value.absent(),
|
||||
this.updatedAt = const i0.Value.absent(),
|
||||
this.quotaSizeInBytes = const i0.Value.absent(),
|
||||
this.quotaUsageInBytes = const i0.Value.absent(),
|
||||
this.deletedAt = const i0.Value.absent(),
|
||||
this.avatarColor = const i0.Value.absent(),
|
||||
});
|
||||
UserEntityCompanion.insert({
|
||||
required String id,
|
||||
required String name,
|
||||
this.isAdmin = const i0.Value.absent(),
|
||||
required String email,
|
||||
this.profileImagePath = const i0.Value.absent(),
|
||||
this.updatedAt = const i0.Value.absent(),
|
||||
this.quotaSizeInBytes = const i0.Value.absent(),
|
||||
this.quotaUsageInBytes = const i0.Value.absent(),
|
||||
this.deletedAt = 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<i1.UserEntityData> custom({
|
||||
i0.Expression<String>? id,
|
||||
i0.Expression<String>? name,
|
||||
i0.Expression<bool>? isAdmin,
|
||||
i0.Expression<String>? email,
|
||||
i0.Expression<String>? profileImagePath,
|
||||
i0.Expression<DateTime>? updatedAt,
|
||||
i0.Expression<int>? quotaSizeInBytes,
|
||||
i0.Expression<int>? quotaUsageInBytes,
|
||||
i0.Expression<DateTime>? deletedAt,
|
||||
i0.Expression<int>? avatarColor,
|
||||
}) {
|
||||
return i0.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,
|
||||
if (deletedAt != null) 'deleted_at': deletedAt,
|
||||
if (avatarColor != null) 'avatar_color': avatarColor,
|
||||
});
|
||||
}
|
||||
|
||||
i1.UserEntityCompanion copyWith(
|
||||
{i0.Value<String>? id,
|
||||
i0.Value<String>? name,
|
||||
i0.Value<bool>? isAdmin,
|
||||
i0.Value<String>? email,
|
||||
i0.Value<String?>? profileImagePath,
|
||||
i0.Value<DateTime>? updatedAt,
|
||||
i0.Value<int?>? quotaSizeInBytes,
|
||||
i0.Value<int>? quotaUsageInBytes}) {
|
||||
i0.Value<DateTime?>? deletedAt,
|
||||
i0.Value<i2.AvatarColor?>? avatarColor}) {
|
||||
return i1.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,
|
||||
deletedAt: deletedAt ?? this.deletedAt,
|
||||
avatarColor: avatarColor ?? this.avatarColor,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -617,23 +456,15 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.UserEntityData> {
|
||||
if (name.present) {
|
||||
map['name'] = i0.Variable<String>(name.value);
|
||||
}
|
||||
if (isAdmin.present) {
|
||||
map['is_admin'] = i0.Variable<bool>(isAdmin.value);
|
||||
}
|
||||
if (email.present) {
|
||||
map['email'] = i0.Variable<String>(email.value);
|
||||
}
|
||||
if (profileImagePath.present) {
|
||||
map['profile_image_path'] = i0.Variable<String>(profileImagePath.value);
|
||||
if (deletedAt.present) {
|
||||
map['deleted_at'] = i0.Variable<DateTime>(deletedAt.value);
|
||||
}
|
||||
if (updatedAt.present) {
|
||||
map['updated_at'] = i0.Variable<DateTime>(updatedAt.value);
|
||||
}
|
||||
if (quotaSizeInBytes.present) {
|
||||
map['quota_size_in_bytes'] = i0.Variable<int>(quotaSizeInBytes.value);
|
||||
}
|
||||
if (quotaUsageInBytes.present) {
|
||||
map['quota_usage_in_bytes'] = i0.Variable<int>(quotaUsageInBytes.value);
|
||||
if (avatarColor.present) {
|
||||
map['avatar_color'] = i0.Variable<int>(
|
||||
i1.$UserEntityTable.$converteravatarColorn.toSql(avatarColor.value));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
@@ -643,12 +474,9 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.UserEntityData> {
|
||||
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('deletedAt: $deletedAt, ')
|
||||
..write('avatarColor: $avatarColor')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
||||
+354
-323
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,9 @@ import 'package:drift/drift.dart';
|
||||
import 'package:drift_flutter/drift_flutter.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:immich_mobile/domain/interfaces/db.interface.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/asset_face.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/asset_face.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/local_album.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/local_album_asset.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/local_asset.entity.dart';
|
||||
@@ -43,6 +44,7 @@ class IsarDatabaseRepository implements IDatabaseRepository {
|
||||
@DriftDatabase(
|
||||
tables: [
|
||||
UserEntity,
|
||||
AuthUserEntity,
|
||||
UserMetadataEntity,
|
||||
PartnerEntity,
|
||||
LocalAlbumEntity,
|
||||
@@ -74,7 +76,7 @@ class Drift extends $Drift implements IDatabaseRepository {
|
||||
);
|
||||
|
||||
@override
|
||||
int get schemaVersion => 4;
|
||||
int get schemaVersion => 5;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration => MigrationStrategy(
|
||||
@@ -102,6 +104,12 @@ class Drift extends $Drift implements IDatabaseRepository {
|
||||
// asset_face_entity is added
|
||||
await m.create(v4.assetFaceEntity);
|
||||
},
|
||||
from4To5: (m, v5) async {
|
||||
// Some column got moved from user_entity to auth_user_entity
|
||||
await m.alterTable(TableMigration(v5.userEntity));
|
||||
// auth_user_entity is added
|
||||
await m.create(v5.authUserEntity);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
+58
-51
@@ -13,29 +13,31 @@ import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.d
|
||||
as i5;
|
||||
import 'package:immich_mobile/infrastructure/entities/local_album_asset.entity.drift.dart'
|
||||
as i6;
|
||||
import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart'
|
||||
as i7;
|
||||
import 'package:immich_mobile/infrastructure/entities/partner.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.drift.dart'
|
||||
as i8;
|
||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/partner.entity.drift.dart'
|
||||
as i9;
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart'
|
||||
as i10;
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart'
|
||||
as i11;
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.drift.dart'
|
||||
as i12;
|
||||
import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart'
|
||||
as i13;
|
||||
import 'package:immich_mobile/infrastructure/entities/memory_asset.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart'
|
||||
as i14;
|
||||
import 'package:immich_mobile/infrastructure/entities/person.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/memory_asset.entity.drift.dart'
|
||||
as i15;
|
||||
import 'package:immich_mobile/infrastructure/entities/asset_face.entity.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/person.entity.drift.dart'
|
||||
as i16;
|
||||
import 'package:immich_mobile/infrastructure/entities/merged_asset.drift.dart'
|
||||
import 'package:immich_mobile/infrastructure/entities/asset_face.entity.drift.dart'
|
||||
as i17;
|
||||
import 'package:drift/internal/modular.dart' as i18;
|
||||
import 'package:immich_mobile/infrastructure/entities/merged_asset.drift.dart'
|
||||
as i18;
|
||||
import 'package:drift/internal/modular.dart' as i19;
|
||||
|
||||
abstract class $Drift extends i0.GeneratedDatabase {
|
||||
$Drift(i0.QueryExecutor e) : super(e);
|
||||
@@ -50,26 +52,28 @@ abstract class $Drift extends i0.GeneratedDatabase {
|
||||
i5.$LocalAlbumEntityTable(this);
|
||||
late final i6.$LocalAlbumAssetEntityTable localAlbumAssetEntity =
|
||||
i6.$LocalAlbumAssetEntityTable(this);
|
||||
late final i7.$UserMetadataEntityTable userMetadataEntity =
|
||||
i7.$UserMetadataEntityTable(this);
|
||||
late final i8.$PartnerEntityTable partnerEntity =
|
||||
i8.$PartnerEntityTable(this);
|
||||
late final i9.$RemoteExifEntityTable remoteExifEntity =
|
||||
i9.$RemoteExifEntityTable(this);
|
||||
late final i10.$RemoteAlbumEntityTable remoteAlbumEntity =
|
||||
i10.$RemoteAlbumEntityTable(this);
|
||||
late final i11.$RemoteAlbumAssetEntityTable remoteAlbumAssetEntity =
|
||||
i11.$RemoteAlbumAssetEntityTable(this);
|
||||
late final i12.$RemoteAlbumUserEntityTable remoteAlbumUserEntity =
|
||||
i12.$RemoteAlbumUserEntityTable(this);
|
||||
late final i13.$MemoryEntityTable memoryEntity = i13.$MemoryEntityTable(this);
|
||||
late final i14.$MemoryAssetEntityTable memoryAssetEntity =
|
||||
i14.$MemoryAssetEntityTable(this);
|
||||
late final i15.$PersonEntityTable personEntity = i15.$PersonEntityTable(this);
|
||||
late final i16.$AssetFaceEntityTable assetFaceEntity =
|
||||
i16.$AssetFaceEntityTable(this);
|
||||
i17.MergedAssetDrift get mergedAssetDrift => i18.ReadDatabaseContainer(this)
|
||||
.accessor<i17.MergedAssetDrift>(i17.MergedAssetDrift.new);
|
||||
late final i7.$AuthUserEntityTable authUserEntity =
|
||||
i7.$AuthUserEntityTable(this);
|
||||
late final i8.$UserMetadataEntityTable userMetadataEntity =
|
||||
i8.$UserMetadataEntityTable(this);
|
||||
late final i9.$PartnerEntityTable partnerEntity =
|
||||
i9.$PartnerEntityTable(this);
|
||||
late final i10.$RemoteExifEntityTable remoteExifEntity =
|
||||
i10.$RemoteExifEntityTable(this);
|
||||
late final i11.$RemoteAlbumEntityTable remoteAlbumEntity =
|
||||
i11.$RemoteAlbumEntityTable(this);
|
||||
late final i12.$RemoteAlbumAssetEntityTable remoteAlbumAssetEntity =
|
||||
i12.$RemoteAlbumAssetEntityTable(this);
|
||||
late final i13.$RemoteAlbumUserEntityTable remoteAlbumUserEntity =
|
||||
i13.$RemoteAlbumUserEntityTable(this);
|
||||
late final i14.$MemoryEntityTable memoryEntity = i14.$MemoryEntityTable(this);
|
||||
late final i15.$MemoryAssetEntityTable memoryAssetEntity =
|
||||
i15.$MemoryAssetEntityTable(this);
|
||||
late final i16.$PersonEntityTable personEntity = i16.$PersonEntityTable(this);
|
||||
late final i17.$AssetFaceEntityTable assetFaceEntity =
|
||||
i17.$AssetFaceEntityTable(this);
|
||||
i18.MergedAssetDrift get mergedAssetDrift => i19.ReadDatabaseContainer(this)
|
||||
.accessor<i18.MergedAssetDrift>(i18.MergedAssetDrift.new);
|
||||
@override
|
||||
Iterable<i0.TableInfo<i0.Table, Object?>> get allTables =>
|
||||
allSchemaEntities.whereType<i0.TableInfo<i0.Table, Object?>>();
|
||||
@@ -84,6 +88,7 @@ abstract class $Drift extends i0.GeneratedDatabase {
|
||||
i4.idxLocalAssetChecksum,
|
||||
i2.uQRemoteAssetOwnerChecksum,
|
||||
i2.idxRemoteAssetChecksum,
|
||||
authUserEntity,
|
||||
userMetadataEntity,
|
||||
partnerEntity,
|
||||
remoteExifEntity,
|
||||
@@ -268,25 +273,27 @@ class $DriftManager {
|
||||
i5.$$LocalAlbumEntityTableTableManager(_db, _db.localAlbumEntity);
|
||||
i6.$$LocalAlbumAssetEntityTableTableManager get localAlbumAssetEntity => i6
|
||||
.$$LocalAlbumAssetEntityTableTableManager(_db, _db.localAlbumAssetEntity);
|
||||
i7.$$UserMetadataEntityTableTableManager get userMetadataEntity =>
|
||||
i7.$$UserMetadataEntityTableTableManager(_db, _db.userMetadataEntity);
|
||||
i8.$$PartnerEntityTableTableManager get partnerEntity =>
|
||||
i8.$$PartnerEntityTableTableManager(_db, _db.partnerEntity);
|
||||
i9.$$RemoteExifEntityTableTableManager get remoteExifEntity =>
|
||||
i9.$$RemoteExifEntityTableTableManager(_db, _db.remoteExifEntity);
|
||||
i10.$$RemoteAlbumEntityTableTableManager get remoteAlbumEntity =>
|
||||
i10.$$RemoteAlbumEntityTableTableManager(_db, _db.remoteAlbumEntity);
|
||||
i11.$$RemoteAlbumAssetEntityTableTableManager get remoteAlbumAssetEntity =>
|
||||
i11.$$RemoteAlbumAssetEntityTableTableManager(
|
||||
i7.$$AuthUserEntityTableTableManager get authUserEntity =>
|
||||
i7.$$AuthUserEntityTableTableManager(_db, _db.authUserEntity);
|
||||
i8.$$UserMetadataEntityTableTableManager get userMetadataEntity =>
|
||||
i8.$$UserMetadataEntityTableTableManager(_db, _db.userMetadataEntity);
|
||||
i9.$$PartnerEntityTableTableManager get partnerEntity =>
|
||||
i9.$$PartnerEntityTableTableManager(_db, _db.partnerEntity);
|
||||
i10.$$RemoteExifEntityTableTableManager get remoteExifEntity =>
|
||||
i10.$$RemoteExifEntityTableTableManager(_db, _db.remoteExifEntity);
|
||||
i11.$$RemoteAlbumEntityTableTableManager get remoteAlbumEntity =>
|
||||
i11.$$RemoteAlbumEntityTableTableManager(_db, _db.remoteAlbumEntity);
|
||||
i12.$$RemoteAlbumAssetEntityTableTableManager get remoteAlbumAssetEntity =>
|
||||
i12.$$RemoteAlbumAssetEntityTableTableManager(
|
||||
_db, _db.remoteAlbumAssetEntity);
|
||||
i12.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i12
|
||||
i13.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i13
|
||||
.$$RemoteAlbumUserEntityTableTableManager(_db, _db.remoteAlbumUserEntity);
|
||||
i13.$$MemoryEntityTableTableManager get memoryEntity =>
|
||||
i13.$$MemoryEntityTableTableManager(_db, _db.memoryEntity);
|
||||
i14.$$MemoryAssetEntityTableTableManager get memoryAssetEntity =>
|
||||
i14.$$MemoryAssetEntityTableTableManager(_db, _db.memoryAssetEntity);
|
||||
i15.$$PersonEntityTableTableManager get personEntity =>
|
||||
i15.$$PersonEntityTableTableManager(_db, _db.personEntity);
|
||||
i16.$$AssetFaceEntityTableTableManager get assetFaceEntity =>
|
||||
i16.$$AssetFaceEntityTableTableManager(_db, _db.assetFaceEntity);
|
||||
i14.$$MemoryEntityTableTableManager get memoryEntity =>
|
||||
i14.$$MemoryEntityTableTableManager(_db, _db.memoryEntity);
|
||||
i15.$$MemoryAssetEntityTableTableManager get memoryAssetEntity =>
|
||||
i15.$$MemoryAssetEntityTableTableManager(_db, _db.memoryAssetEntity);
|
||||
i16.$$PersonEntityTableTableManager get personEntity =>
|
||||
i16.$$PersonEntityTableTableManager(_db, _db.personEntity);
|
||||
i17.$$AssetFaceEntityTableTableManager get assetFaceEntity =>
|
||||
i17.$$AssetFaceEntityTableTableManager(_db, _db.assetFaceEntity);
|
||||
}
|
||||
|
||||
+965
-266
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
final Drift _db;
|
||||
const DriftPartnerRepository(this._db) : super(_db);
|
||||
|
||||
Future<List<PartnerUserDto>> getPartners(String userId) {
|
||||
Future<List<PartnerUser>> getPartners(String userId) {
|
||||
final query = _db.select(_db.partnerEntity).join([
|
||||
innerJoin(
|
||||
_db.userEntity,
|
||||
@@ -21,7 +21,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
return query.map((row) {
|
||||
final user = row.readTable(_db.userEntity);
|
||||
final partner = row.readTable(_db.partnerEntity);
|
||||
return PartnerUserDto(
|
||||
return PartnerUser(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
@@ -31,11 +31,11 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
}
|
||||
|
||||
// Get users who we can share our library with
|
||||
Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) {
|
||||
Future<List<PartnerUser>> getAvailablePartners(String currentUserId) {
|
||||
final query = _db.select(_db.userEntity)..where((row) => row.id.equals(currentUserId).not());
|
||||
|
||||
return query.map((user) {
|
||||
return PartnerUserDto(
|
||||
return PartnerUser(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
@@ -45,7 +45,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
}
|
||||
|
||||
// Get users who are sharing their photos WITH the current user
|
||||
Future<List<PartnerUserDto>> getSharedWith(String partnerId) {
|
||||
Future<List<PartnerUser>> getSharedWith(String partnerId) {
|
||||
final query = _db.select(_db.partnerEntity).join([
|
||||
innerJoin(
|
||||
_db.userEntity,
|
||||
@@ -59,7 +59,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
return query.map((row) {
|
||||
final user = row.readTable(_db.userEntity);
|
||||
final partner = row.readTable(_db.partnerEntity);
|
||||
return PartnerUserDto(
|
||||
return PartnerUser(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
@@ -69,7 +69,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
}
|
||||
|
||||
// Get users who the current user is sharing their photos TO
|
||||
Future<List<PartnerUserDto>> getSharedBy(String userId) {
|
||||
Future<List<PartnerUser>> getSharedBy(String userId) {
|
||||
final query = _db.select(_db.partnerEntity).join([
|
||||
innerJoin(
|
||||
_db.userEntity,
|
||||
@@ -83,7 +83,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
return query.map((row) {
|
||||
final user = row.readTable(_db.userEntity);
|
||||
final partner = row.readTable(_db.partnerEntity);
|
||||
return PartnerUserDto(
|
||||
return PartnerUser(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
@@ -106,7 +106,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
return allPartnerIds;
|
||||
}
|
||||
|
||||
Future<PartnerUserDto?> getPartner(String partnerId, String userId) {
|
||||
Future<PartnerUser?> getPartner(String partnerId, String userId) {
|
||||
final query = _db.select(_db.partnerEntity).join([
|
||||
innerJoin(
|
||||
_db.userEntity,
|
||||
@@ -120,7 +120,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
return query.map((row) {
|
||||
final user = row.readTable(_db.userEntity);
|
||||
final partner = row.readTable(_db.partnerEntity);
|
||||
return PartnerUserDto(
|
||||
return PartnerUser(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
@@ -129,7 +129,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||
}).getSingleOrNull();
|
||||
}
|
||||
|
||||
Future<bool> toggleShowInTimeline(PartnerUserDto partner, String userId) {
|
||||
Future<bool> toggleShowInTimeline(PartnerUser partner, String userId) {
|
||||
return _db.partnerEntity.update().replace(
|
||||
PartnerEntityCompanion(
|
||||
sharedById: Value(partner.id),
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||
|
||||
enum SortRemoteAlbumsBy { id, updatedAt }
|
||||
@@ -40,8 +41,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||
]);
|
||||
query
|
||||
..where(_db.remoteAssetEntity.deletedAt.isNull())
|
||||
..addColumns([assetCount])
|
||||
..addColumns([_db.userEntity.name])
|
||||
..addColumns([assetCount, _db.userEntity.name])
|
||||
..groupBy([_db.remoteAlbumEntity.id]);
|
||||
|
||||
if (sortBy.isNotEmpty) {
|
||||
@@ -147,34 +147,18 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||
}).getSingle();
|
||||
}
|
||||
|
||||
Future<List<UserDto>> getSharedUsers(String albumId) async {
|
||||
final albumUserRows =
|
||||
await (_db.select(_db.remoteAlbumUserEntity)..where((row) => row.albumId.equals(albumId))).get();
|
||||
Future<List<User>> getSharedUsers(String albumId) async {
|
||||
final query = _db.remoteAlbumUserEntity.selectOnly()
|
||||
..join([
|
||||
innerJoin(
|
||||
_db.userEntity,
|
||||
_db.userEntity.id.equalsExp(_db.remoteAlbumUserEntity.userId),
|
||||
useColumns: true,
|
||||
),
|
||||
])
|
||||
..where(_db.remoteAlbumUserEntity.albumId.equals(albumId));
|
||||
|
||||
if (albumUserRows.isEmpty) {
|
||||
return [];
|
||||
}
|
||||
|
||||
final userIds = albumUserRows.map((row) => row.userId);
|
||||
|
||||
return (_db.select(_db.userEntity)..where((row) => row.id.isIn(userIds)))
|
||||
.map(
|
||||
(user) => UserDto(
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
profileImagePath: user.profileImagePath?.isEmpty == true ? null : user.profileImagePath,
|
||||
isAdmin: user.isAdmin,
|
||||
updatedAt: user.updatedAt,
|
||||
quotaSizeInBytes: user.quotaSizeInBytes ?? 0,
|
||||
quotaUsageInBytes: user.quotaUsageInBytes,
|
||||
memoryEnabled: true,
|
||||
inTimeline: false,
|
||||
isPartnerSharedBy: false,
|
||||
isPartnerSharedWith: false,
|
||||
),
|
||||
)
|
||||
.get();
|
||||
return query.map((row) => row.readTable(_db.userEntity).toDto()).get();
|
||||
}
|
||||
|
||||
Future<List<RemoteAsset>> getAssets(String albumId) {
|
||||
|
||||
@@ -41,6 +41,7 @@ class SyncApiRepository {
|
||||
request.body = jsonEncode(
|
||||
SyncStreamDto(
|
||||
types: [
|
||||
SyncRequestType.authUsersV1,
|
||||
SyncRequestType.usersV1,
|
||||
SyncRequestType.assetsV1,
|
||||
SyncRequestType.assetExifsV1,
|
||||
@@ -138,6 +139,7 @@ class SyncApiRepository {
|
||||
}
|
||||
|
||||
const _kResponseMap = <SyncEntityType, Function(Object)>{
|
||||
SyncEntityType.authUserV1: SyncAuthUserV1.fromJson,
|
||||
SyncEntityType.userV1: SyncUserV1.fromJson,
|
||||
SyncEntityType.userDeleteV1: SyncUserDeleteV1.fromJson,
|
||||
SyncEntityType.partnerV1: SyncPartnerV1.fromJson,
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
||||
import 'package:immich_mobile/domain/models/memory.model.dart';
|
||||
import 'package:immich_mobile/domain/models/user_metadata.model.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/asset_face.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/auth_user.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/memory_asset.entity.drift.dart';
|
||||
@@ -29,6 +30,38 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||
|
||||
SyncStreamRepository(super.db) : _db = db;
|
||||
|
||||
Future<void> updateAuthUsersV1(Iterable<SyncAuthUserV1> data) async {
|
||||
try {
|
||||
await _db.batch((batch) {
|
||||
for (final authUser in data) {
|
||||
final companion = AuthUserEntityCompanion(
|
||||
name: Value(authUser.name),
|
||||
email: Value(authUser.email),
|
||||
deletedAt: Value(authUser.deletedAt),
|
||||
avatarColor: Value(authUser.avatarColor?.toAvatarColor()),
|
||||
isAdmin: Value(authUser.isAdmin),
|
||||
oauthId: Value(authUser.oauthId),
|
||||
pinCode: Value(authUser.pinCode),
|
||||
hasProfileImage: Value(authUser.hasProfileImage),
|
||||
profileChangedAt: Value(authUser.profileChangedAt),
|
||||
quotaSizeInBytes: Value(authUser.quotaSizeInBytes),
|
||||
quotaUsageInBytes: Value(authUser.quotaUsageInBytes),
|
||||
storageLabel: Value(authUser.storageLabel),
|
||||
);
|
||||
|
||||
batch.insert(
|
||||
_db.authUserEntity,
|
||||
companion.copyWith(id: Value(authUser.id)),
|
||||
onConflict: DoUpdate((_) => companion),
|
||||
);
|
||||
}
|
||||
});
|
||||
} catch (error, stack) {
|
||||
_logger.severe('Error: SyncAuthUserV1', error, stack);
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteUsersV1(Iterable<SyncUserDeleteV1> data) async {
|
||||
try {
|
||||
await _db.userEntity.deleteWhere((row) => row.id.isIn(data.map((e) => e.userId)));
|
||||
@@ -45,6 +78,8 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||
final companion = UserEntityCompanion(
|
||||
name: Value(user.name),
|
||||
email: Value(user.email),
|
||||
deletedAt: Value(user.deletedAt),
|
||||
avatarColor: Value(user.avatarColor?.toAvatarColor()),
|
||||
);
|
||||
|
||||
batch.insert(
|
||||
@@ -604,6 +639,22 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||
}
|
||||
}
|
||||
|
||||
extension on UserAvatarColor {
|
||||
AvatarColor toAvatarColor() => switch (this) {
|
||||
UserAvatarColor.amber => AvatarColor.amber,
|
||||
UserAvatarColor.blue => AvatarColor.blue,
|
||||
UserAvatarColor.gray => AvatarColor.gray,
|
||||
UserAvatarColor.green => AvatarColor.green,
|
||||
UserAvatarColor.orange => AvatarColor.orange,
|
||||
UserAvatarColor.pink => AvatarColor.pink,
|
||||
UserAvatarColor.primary => AvatarColor.primary,
|
||||
UserAvatarColor.purple => AvatarColor.purple,
|
||||
UserAvatarColor.red => AvatarColor.red,
|
||||
UserAvatarColor.yellow => AvatarColor.yellow,
|
||||
_ => throw Exception('Unknown AvatarColor value: $this'),
|
||||
};
|
||||
}
|
||||
|
||||
extension on AssetTypeEnum {
|
||||
AssetType toAssetType() => switch (this) {
|
||||
AssetTypeEnum.IMAGE => AssetType.image,
|
||||
|
||||
@@ -263,7 +263,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||
required int offset,
|
||||
required int count,
|
||||
}) async {
|
||||
final albumData = await (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId))).getSingleOrNull();
|
||||
final albumData = await _db.managers.remoteAlbumEntity.filter((row) => row.id.equals(albumId)).getSingleOrNull();
|
||||
|
||||
// If album doesn't exist (was deleted), return empty list
|
||||
if (albumData == null) {
|
||||
|
||||
@@ -10,18 +10,18 @@ class IsarUserRepository extends IsarDatabaseRepository {
|
||||
|
||||
Future<void> delete(List<String> ids) async {
|
||||
await transaction(() async {
|
||||
await _db.users.deleteAllById(ids);
|
||||
await _db.isarUsers.deleteAllById(ids);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> deleteAll() async {
|
||||
await transaction(() async {
|
||||
await _db.users.clear();
|
||||
await _db.isarUsers.clear();
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<UserDto>> getAll({SortUserBy? sortBy}) async {
|
||||
return (await _db.users
|
||||
return (await _db.isarUsers
|
||||
.where()
|
||||
.optional(
|
||||
sortBy != null,
|
||||
@@ -35,31 +35,44 @@ class IsarUserRepository extends IsarDatabaseRepository {
|
||||
}
|
||||
|
||||
Future<UserDto?> getByUserId(String id) async {
|
||||
return (await _db.users.getById(id))?.toDto();
|
||||
return (await _db.isarUsers.getById(id))?.toDto();
|
||||
}
|
||||
|
||||
Future<List<UserDto?>> getByUserIds(List<String> ids) async {
|
||||
return (await _db.users.getAllById(ids)).map((u) => u?.toDto()).toList();
|
||||
return (await _db.isarUsers.getAllById(ids)).map((u) => u?.toDto()).toList();
|
||||
}
|
||||
|
||||
Future<bool> insert(UserDto user) async {
|
||||
await transaction(() async {
|
||||
await _db.users.put(entity.User.fromDto(user));
|
||||
await _db.isarUsers.put(entity.IsarUser.fromDto(user));
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<UserDto> update(UserDto user) async {
|
||||
await transaction(() async {
|
||||
await _db.users.put(entity.User.fromDto(user));
|
||||
await _db.isarUsers.put(entity.IsarUser.fromDto(user));
|
||||
});
|
||||
return user;
|
||||
}
|
||||
|
||||
Future<bool> updateAll(List<UserDto> users) async {
|
||||
await transaction(() async {
|
||||
await _db.users.putAll(users.map(entity.User.fromDto).toList());
|
||||
await _db.isarUsers.putAll(users.map(entity.IsarUser.fromDto).toList());
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class DriftUserRepository extends DriftDatabaseRepository {
|
||||
final Drift _db;
|
||||
const DriftUserRepository(this._db) : super(_db);
|
||||
|
||||
Future<List<User>> getAll() {
|
||||
return _db.managers.userEntity.orderBy((row) => row.id.asc()).map((row) => row.toDto()).get();
|
||||
}
|
||||
|
||||
Future<User?> getById(String id) {
|
||||
return _db.managers.userEntity.filter((row) => row.id.equals(id)).map((row) => row.toDto()).getSingleOrNull();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user