2025-06-03 21:31:50 +05:30
// dart format width=80
// ignore_for_file: type=lint
import ' package:drift/drift.dart ' as i0 ;
import ' package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart '
as i1 ;
import ' package:immich_mobile/domain/models/asset/base_asset.model.dart ' as i2 ;
import ' package:immich_mobile/infrastructure/entities/remote_asset.entity.dart '
as i3 ;
import ' package:drift/src/runtime/query_builder/query_builder.dart ' as i4 ;
import ' package:immich_mobile/infrastructure/entities/user.entity.drift.dart '
as i5 ;
import ' package:drift/internal/modular.dart ' as i6 ;
2025-07-29 00:34:03 +05:30
typedef $ $RemoteAssetEntityTableCreateCompanionBuilder =
i1 . RemoteAssetEntityCompanion Function ( {
required String name ,
required i2 . AssetType type ,
i0 . Value < DateTime > createdAt ,
i0 . Value < DateTime > updatedAt ,
i0 . Value < int ? > width ,
i0 . Value < int ? > height ,
i0 . Value < int ? > durationInSeconds ,
required String id ,
required String checksum ,
i0 . Value < bool > isFavorite ,
required String ownerId ,
i0 . Value < DateTime ? > localDateTime ,
i0 . Value < String ? > thumbHash ,
i0 . Value < DateTime ? > deletedAt ,
i0 . Value < String ? > livePhotoVideoId ,
required i2 . AssetVisibility visibility ,
i0 . Value < String ? > stackId ,
2025-07-30 23:59:00 +05:30
i0 . Value < String ? > libraryId ,
2025-07-29 00:34:03 +05:30
} ) ;
typedef $ $RemoteAssetEntityTableUpdateCompanionBuilder =
i1 . RemoteAssetEntityCompanion Function ( {
i0 . Value < String > name ,
i0 . Value < i2 . AssetType > type ,
i0 . Value < DateTime > createdAt ,
i0 . Value < DateTime > updatedAt ,
i0 . Value < int ? > width ,
i0 . Value < int ? > height ,
i0 . Value < int ? > durationInSeconds ,
i0 . Value < String > id ,
i0 . Value < String > checksum ,
i0 . Value < bool > isFavorite ,
i0 . Value < String > ownerId ,
i0 . Value < DateTime ? > localDateTime ,
i0 . Value < String ? > thumbHash ,
i0 . Value < DateTime ? > deletedAt ,
i0 . Value < String ? > livePhotoVideoId ,
i0 . Value < i2 . AssetVisibility > visibility ,
i0 . Value < String ? > stackId ,
2025-07-30 23:59:00 +05:30
i0 . Value < String ? > libraryId ,
2025-07-29 00:34:03 +05:30
} ) ;
final class $ $RemoteAssetEntityTableReferences
extends
i0 . BaseReferences <
i0 . GeneratedDatabase ,
i1 . $RemoteAssetEntityTable ,
i1 . RemoteAssetEntityData
> {
2025-06-03 21:31:50 +05:30
$ $RemoteAssetEntityTableReferences (
2025-07-29 00:34:03 +05:30
super . $_db ,
super . $_table ,
super . $_typedResult ,
) ;
2025-06-03 21:31:50 +05:30
static i5 . $UserEntityTable _ownerIdTable ( i0 . GeneratedDatabase db ) = >
i6 . ReadDatabaseContainer ( db )
. resultSet < i5 . $UserEntityTable > ( ' user_entity ' )
2025-07-29 00:34:03 +05:30
. createAlias (
i0 . $_aliasNameGenerator (
2025-06-03 21:31:50 +05:30
i6 . ReadDatabaseContainer ( db )
. resultSet < i1 . $RemoteAssetEntityTable > ( ' remote_asset_entity ' )
. ownerId ,
2025-07-29 00:34:03 +05:30
i6 . ReadDatabaseContainer (
db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) . id ,
) ,
) ;
2025-06-03 21:31:50 +05:30
i5 . $ $UserEntityTableProcessedTableManager get ownerId {
final $_column = $_itemColumn < String > ( ' owner_id ' ) ! ;
final manager = i5
. $ $UserEntityTableTableManager (
2025-07-29 00:34:03 +05:30
$_db ,
i6 . ReadDatabaseContainer (
2025-06-03 21:31:50 +05:30
$_db ,
2025-07-29 00:34:03 +05:30
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
)
2025-06-03 21:31:50 +05:30
. filter ( ( f ) = > f . id . sqlEquals ( $_column ) ) ;
final item = $_typedResult . readTableOrNull ( _ownerIdTable ( $_db ) ) ;
if ( item = = null ) return manager ;
return i0 . ProcessedTableManager (
2025-07-29 00:34:03 +05:30
manager . $state . copyWith ( prefetchedData: [ item ] ) ,
) ;
2025-06-03 21:31:50 +05:30
}
}
class $ $RemoteAssetEntityTableFilterComposer
extends i0 . Composer < i0 . GeneratedDatabase , i1 . $RemoteAssetEntityTable > {
$ $RemoteAssetEntityTableFilterComposer ( {
required super . $db ,
required super . $table ,
super . joinBuilder ,
super . $addJoinBuilderToRootComposer ,
super . $removeJoinBuilderFromRootComposer ,
} ) ;
i0 . ColumnFilters < String > get name = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . name ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnWithTypeConverterFilters < i2 . AssetType , i2 . AssetType , int > get type = >
$composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . type ,
builder: ( column ) = > i0 . ColumnWithTypeConverterFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < DateTime > get createdAt = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . createdAt ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < DateTime > get updatedAt = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . updatedAt ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
2025-06-09 08:20:54 +05:30
i0 . ColumnFilters < int > get width = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . width ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-09 08:20:54 +05:30
i0 . ColumnFilters < int > get height = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . height ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-09 08:20:54 +05:30
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < int > get durationInSeconds = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . durationInSeconds ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < String > get id = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . id ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < String > get checksum = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . checksum ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < bool > get isFavorite = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . isFavorite ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < DateTime > get localDateTime = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . localDateTime ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < String > get thumbHash = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . thumbHash ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnFilters < DateTime > get deletedAt = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . deletedAt ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
2025-07-15 00:53:24 +05:30
i0 . ColumnFilters < String > get livePhotoVideoId = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . livePhotoVideoId ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-07-15 00:53:24 +05:30
2025-06-03 21:31:50 +05:30
i0 . ColumnWithTypeConverterFilters < i2 . AssetVisibility , i2 . AssetVisibility , int >
2025-07-29 00:34:03 +05:30
get visibility = > $composableBuilder (
column: $table . visibility ,
builder: ( column ) = > i0 . ColumnWithTypeConverterFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
2025-07-18 10:01:04 +05:30
i0 . ColumnFilters < String > get stackId = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . stackId ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-07-18 10:01:04 +05:30
2025-07-30 23:59:00 +05:30
i0 . ColumnFilters < String > get libraryId = > $composableBuilder (
column: $table . libraryId ,
builder: ( column ) = > i0 . ColumnFilters ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i5 . $ $UserEntityTableFilterComposer get ownerId {
final i5 . $ $UserEntityTableFilterComposer composer = $composerBuilder (
2025-07-29 00:34:03 +05:30
composer: this ,
getCurrentColumn: ( t ) = > t . ownerId ,
referencedTable: i6 . ReadDatabaseContainer (
$db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
getReferencedColumn: ( t ) = > t . id ,
builder:
(
joinBuilder , {
$addJoinBuilderToRootComposer ,
$removeJoinBuilderFromRootComposer ,
} ) = > i5 . $ $UserEntityTableFilterComposer (
$db: $db ,
$table: i6 . ReadDatabaseContainer (
$db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer ,
joinBuilder: joinBuilder ,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer ,
) ,
) ;
2025-06-03 21:31:50 +05:30
return composer ;
}
}
class $ $RemoteAssetEntityTableOrderingComposer
extends i0 . Composer < i0 . GeneratedDatabase , i1 . $RemoteAssetEntityTable > {
$ $RemoteAssetEntityTableOrderingComposer ( {
required super . $db ,
required super . $table ,
super . joinBuilder ,
super . $addJoinBuilderToRootComposer ,
super . $removeJoinBuilderFromRootComposer ,
} ) ;
i0 . ColumnOrderings < String > get name = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . name ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < int > get type = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . type ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < DateTime > get createdAt = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . createdAt ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < DateTime > get updatedAt = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . updatedAt ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
2025-06-09 08:20:54 +05:30
i0 . ColumnOrderings < int > get width = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . width ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-09 08:20:54 +05:30
i0 . ColumnOrderings < int > get height = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . height ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-09 08:20:54 +05:30
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < int > get durationInSeconds = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . durationInSeconds ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < String > get id = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . id ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < String > get checksum = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . checksum ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < bool > get isFavorite = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . isFavorite ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < DateTime > get localDateTime = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . localDateTime ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < String > get thumbHash = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . thumbHash ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < DateTime > get deletedAt = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . deletedAt ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
2025-07-15 00:53:24 +05:30
i0 . ColumnOrderings < String > get livePhotoVideoId = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . livePhotoVideoId ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-07-15 00:53:24 +05:30
2025-06-03 21:31:50 +05:30
i0 . ColumnOrderings < int > get visibility = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . visibility ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
2025-07-18 10:01:04 +05:30
i0 . ColumnOrderings < String > get stackId = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . stackId ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-07-18 10:01:04 +05:30
2025-07-30 23:59:00 +05:30
i0 . ColumnOrderings < String > get libraryId = > $composableBuilder (
column: $table . libraryId ,
builder: ( column ) = > i0 . ColumnOrderings ( column ) ,
) ;
2025-06-03 21:31:50 +05:30
i5 . $ $UserEntityTableOrderingComposer get ownerId {
final i5 . $ $UserEntityTableOrderingComposer composer = $composerBuilder (
2025-07-29 00:34:03 +05:30
composer: this ,
getCurrentColumn: ( t ) = > t . ownerId ,
referencedTable: i6 . ReadDatabaseContainer (
$db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
getReferencedColumn: ( t ) = > t . id ,
builder:
(
joinBuilder , {
$addJoinBuilderToRootComposer ,
$removeJoinBuilderFromRootComposer ,
} ) = > i5 . $ $UserEntityTableOrderingComposer (
$db: $db ,
$table: i6 . ReadDatabaseContainer (
$db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer ,
joinBuilder: joinBuilder ,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer ,
) ,
) ;
2025-06-03 21:31:50 +05:30
return composer ;
}
}
class $ $RemoteAssetEntityTableAnnotationComposer
extends i0 . Composer < i0 . GeneratedDatabase , i1 . $RemoteAssetEntityTable > {
$ $RemoteAssetEntityTableAnnotationComposer ( {
required super . $db ,
required super . $table ,
super . joinBuilder ,
super . $addJoinBuilderToRootComposer ,
super . $removeJoinBuilderFromRootComposer ,
} ) ;
i0 . GeneratedColumn < String > get name = >
$composableBuilder ( column: $table . name , builder: ( column ) = > column ) ;
i0 . GeneratedColumnWithTypeConverter < i2 . AssetType , int > get type = >
$composableBuilder ( column: $table . type , builder: ( column ) = > column ) ;
i0 . GeneratedColumn < DateTime > get createdAt = >
$composableBuilder ( column: $table . createdAt , builder: ( column ) = > column ) ;
i0 . GeneratedColumn < DateTime > get updatedAt = >
$composableBuilder ( column: $table . updatedAt , builder: ( column ) = > column ) ;
2025-06-09 08:20:54 +05:30
i0 . GeneratedColumn < int > get width = >
$composableBuilder ( column: $table . width , builder: ( column ) = > column ) ;
i0 . GeneratedColumn < int > get height = >
$composableBuilder ( column: $table . height , builder: ( column ) = > column ) ;
2025-06-03 21:31:50 +05:30
i0 . GeneratedColumn < int > get durationInSeconds = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . durationInSeconds ,
builder: ( column ) = > column ,
) ;
2025-06-03 21:31:50 +05:30
i0 . GeneratedColumn < String > get id = >
$composableBuilder ( column: $table . id , builder: ( column ) = > column ) ;
i0 . GeneratedColumn < String > get checksum = >
$composableBuilder ( column: $table . checksum , builder: ( column ) = > column ) ;
i0 . GeneratedColumn < bool > get isFavorite = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . isFavorite ,
builder: ( column ) = > column ,
) ;
2025-06-03 21:31:50 +05:30
i0 . GeneratedColumn < DateTime > get localDateTime = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . localDateTime ,
builder: ( column ) = > column ,
) ;
2025-06-03 21:31:50 +05:30
i0 . GeneratedColumn < String > get thumbHash = >
$composableBuilder ( column: $table . thumbHash , builder: ( column ) = > column ) ;
i0 . GeneratedColumn < DateTime > get deletedAt = >
$composableBuilder ( column: $table . deletedAt , builder: ( column ) = > column ) ;
2025-07-15 00:53:24 +05:30
i0 . GeneratedColumn < String > get livePhotoVideoId = > $composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . livePhotoVideoId ,
builder: ( column ) = > column ,
) ;
2025-07-15 00:53:24 +05:30
2025-06-03 21:31:50 +05:30
i0 . GeneratedColumnWithTypeConverter < i2 . AssetVisibility , int > get visibility = >
$composableBuilder (
2025-07-29 00:34:03 +05:30
column: $table . visibility ,
builder: ( column ) = > column ,
) ;
2025-06-03 21:31:50 +05:30
2025-07-18 10:01:04 +05:30
i0 . GeneratedColumn < String > get stackId = >
$composableBuilder ( column: $table . stackId , builder: ( column ) = > column ) ;
2025-07-30 23:59:00 +05:30
i0 . GeneratedColumn < String > get libraryId = >
$composableBuilder ( column: $table . libraryId , builder: ( column ) = > column ) ;
2025-06-03 21:31:50 +05:30
i5 . $ $UserEntityTableAnnotationComposer get ownerId {
final i5 . $ $UserEntityTableAnnotationComposer composer = $composerBuilder (
2025-07-29 00:34:03 +05:30
composer: this ,
getCurrentColumn: ( t ) = > t . ownerId ,
referencedTable: i6 . ReadDatabaseContainer (
$db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
getReferencedColumn: ( t ) = > t . id ,
builder:
(
joinBuilder , {
$addJoinBuilderToRootComposer ,
$removeJoinBuilderFromRootComposer ,
} ) = > i5 . $ $UserEntityTableAnnotationComposer (
$db: $db ,
$table: i6 . ReadDatabaseContainer (
$db ,
) . resultSet < i5 . $UserEntityTable > ( ' user_entity ' ) ,
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer ,
joinBuilder: joinBuilder ,
$removeJoinBuilderFromRootComposer:
$removeJoinBuilderFromRootComposer ,
) ,
) ;
2025-06-03 21:31:50 +05:30
return composer ;
}
}
2025-07-29 00:34:03 +05:30
class $ $RemoteAssetEntityTableTableManager
extends
i0 . RootTableManager <
i0 . GeneratedDatabase ,
i1 . $RemoteAssetEntityTable ,
i1 . RemoteAssetEntityData ,
i1 . $ $RemoteAssetEntityTableFilterComposer ,
i1 . $ $RemoteAssetEntityTableOrderingComposer ,
i1 . $ $RemoteAssetEntityTableAnnotationComposer ,
$ $RemoteAssetEntityTableCreateCompanionBuilder ,
$ $RemoteAssetEntityTableUpdateCompanionBuilder ,
( i1 . RemoteAssetEntityData , i1 . $ $RemoteAssetEntityTableReferences ) ,
i1 . RemoteAssetEntityData ,
i0 . PrefetchHooks Function ( { bool ownerId } )
> {
2025-06-03 21:31:50 +05:30
$ $RemoteAssetEntityTableTableManager (
2025-07-29 00:34:03 +05:30
i0 . GeneratedDatabase db ,
i1 . $RemoteAssetEntityTable table ,
) : super (
i0 . TableManagerState (
2025-06-03 21:31:50 +05:30
db: db ,
table: table ,
createFilteringComposer: ( ) = >
i1 . $ $RemoteAssetEntityTableFilterComposer ( $db: db , $table: table ) ,
createOrderingComposer: ( ) = > i1
. $ $RemoteAssetEntityTableOrderingComposer ( $db: db , $table: table ) ,
createComputedFieldComposer: ( ) = >
i1 . $ $RemoteAssetEntityTableAnnotationComposer (
2025-07-29 00:34:03 +05:30
$db: db ,
$table: table ,
) ,
updateCompanionCallback:
( {
i0 . Value < String > name = const i0 . Value . absent ( ) ,
i0 . Value < i2 . AssetType > type = const i0 . Value . absent ( ) ,
i0 . Value < DateTime > createdAt = const i0 . Value . absent ( ) ,
i0 . Value < DateTime > updatedAt = const i0 . Value . absent ( ) ,
i0 . Value < int ? > width = const i0 . Value . absent ( ) ,
i0 . Value < int ? > height = const i0 . Value . absent ( ) ,
i0 . Value < int ? > durationInSeconds = const i0 . Value . absent ( ) ,
i0 . Value < String > id = const i0 . Value . absent ( ) ,
i0 . Value < String > checksum = const i0 . Value . absent ( ) ,
i0 . Value < bool > isFavorite = const i0 . Value . absent ( ) ,
i0 . Value < String > ownerId = const i0 . Value . absent ( ) ,
i0 . Value < DateTime ? > localDateTime = const i0 . Value . absent ( ) ,
i0 . Value < String ? > thumbHash = const i0 . Value . absent ( ) ,
i0 . Value < DateTime ? > deletedAt = const i0 . Value . absent ( ) ,
i0 . Value < String ? > livePhotoVideoId = const i0 . Value . absent ( ) ,
i0 . Value < i2 . AssetVisibility > visibility =
const i0 . Value . absent ( ) ,
i0 . Value < String ? > stackId = const i0 . Value . absent ( ) ,
2025-07-30 23:59:00 +05:30
i0 . Value < String ? > libraryId = const i0 . Value . absent ( ) ,
2025-07-29 00:34:03 +05:30
} ) = > i1 . RemoteAssetEntityCompanion (
name: name ,
type: type ,
createdAt: createdAt ,
updatedAt: updatedAt ,
width: width ,
height: height ,
durationInSeconds: durationInSeconds ,
id: id ,
checksum: checksum ,
isFavorite: isFavorite ,
ownerId: ownerId ,
localDateTime: localDateTime ,
thumbHash: thumbHash ,
deletedAt: deletedAt ,
livePhotoVideoId: livePhotoVideoId ,
visibility: visibility ,
stackId: stackId ,
2025-07-30 23:59:00 +05:30
libraryId: libraryId ,
2025-07-29 00:34:03 +05:30
) ,
createCompanionCallback:
( {
required String name ,
required i2 . AssetType type ,
i0 . Value < DateTime > createdAt = const i0 . Value . absent ( ) ,
i0 . Value < DateTime > updatedAt = const i0 . Value . absent ( ) ,
i0 . Value < int ? > width = const i0 . Value . absent ( ) ,
i0 . Value < int ? > height = const i0 . Value . absent ( ) ,
i0 . Value < int ? > durationInSeconds = const i0 . Value . absent ( ) ,
required String id ,
required String checksum ,
i0 . Value < bool > isFavorite = const i0 . Value . absent ( ) ,
required String ownerId ,
i0 . Value < DateTime ? > localDateTime = const i0 . Value . absent ( ) ,
i0 . Value < String ? > thumbHash = const i0 . Value . absent ( ) ,
i0 . Value < DateTime ? > deletedAt = const i0 . Value . absent ( ) ,
i0 . Value < String ? > livePhotoVideoId = const i0 . Value . absent ( ) ,
required i2 . AssetVisibility visibility ,
i0 . Value < String ? > stackId = const i0 . Value . absent ( ) ,
2025-07-30 23:59:00 +05:30
i0 . Value < String ? > libraryId = const i0 . Value . absent ( ) ,
2025-07-29 00:34:03 +05:30
} ) = > i1 . RemoteAssetEntityCompanion . insert (
name: name ,
type: type ,
createdAt: createdAt ,
updatedAt: updatedAt ,
width: width ,
height: height ,
durationInSeconds: durationInSeconds ,
id: id ,
checksum: checksum ,
isFavorite: isFavorite ,
ownerId: ownerId ,
localDateTime: localDateTime ,
thumbHash: thumbHash ,
deletedAt: deletedAt ,
livePhotoVideoId: livePhotoVideoId ,
visibility: visibility ,
stackId: stackId ,
2025-07-30 23:59:00 +05:30
libraryId: libraryId ,
2025-07-29 00:34:03 +05:30
) ,
2025-06-03 21:31:50 +05:30
withReferenceMapper: ( p0 ) = > p0
2025-07-29 00:34:03 +05:30
. map (
( e ) = > (
e . readTable ( table ) ,
i1 . $ $RemoteAssetEntityTableReferences ( db , table , e ) ,
) ,
)
2025-06-03 21:31:50 +05:30
. toList ( ) ,
prefetchHooksCallback: ( { ownerId = false } ) {
return i0 . PrefetchHooks (
db: db ,
explicitlyWatchedTables: [ ] ,
2025-07-29 00:34:03 +05:30
addJoins:
<
T extends i0 . TableManagerState <
2025-06-03 21:31:50 +05:30
dynamic ,
dynamic ,
dynamic ,
dynamic ,
dynamic ,
dynamic ,
dynamic ,
dynamic ,
dynamic ,
dynamic ,
2025-07-29 00:34:03 +05:30
dynamic
>
> ( state ) {
if ( ownerId ) {
state =
state . withJoin (
currentTable: table ,
currentColumn: table . ownerId ,
referencedTable: i1
. $ $RemoteAssetEntityTableReferences
. _ownerIdTable ( db ) ,
referencedColumn: i1
. $ $RemoteAssetEntityTableReferences
. _ownerIdTable ( db )
. id ,
)
as T ;
}
return state ;
} ,
2025-06-03 21:31:50 +05:30
getPrefetchedDataCallback: ( items ) async {
return [ ] ;
} ,
) ;
} ,
2025-07-29 00:34:03 +05:30
) ,
) ;
2025-06-03 21:31:50 +05:30
}
2025-07-29 00:34:03 +05:30
typedef $ $RemoteAssetEntityTableProcessedTableManager =
i0 . ProcessedTableManager <
i0 . GeneratedDatabase ,
i1 . $RemoteAssetEntityTable ,
i1 . RemoteAssetEntityData ,
i1 . $ $RemoteAssetEntityTableFilterComposer ,
i1 . $ $RemoteAssetEntityTableOrderingComposer ,
i1 . $ $RemoteAssetEntityTableAnnotationComposer ,
$ $RemoteAssetEntityTableCreateCompanionBuilder ,
$ $RemoteAssetEntityTableUpdateCompanionBuilder ,
( i1 . RemoteAssetEntityData , i1 . $ $RemoteAssetEntityTableReferences ) ,
i1 . RemoteAssetEntityData ,
i0 . PrefetchHooks Function ( { bool ownerId } )
> ;
2025-07-30 23:59:00 +05:30
i0 . Index get idxRemoteAssetOwnerChecksum = > i0 . Index (
' idx_remote_asset_owner_checksum ' ,
2025-08-07 03:27:33 +05:30
' CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum) ' ,
2025-07-29 00:34:03 +05:30
) ;
2025-06-03 21:31:50 +05:30
class $RemoteAssetEntityTable extends i3 . RemoteAssetEntity
with i0 . TableInfo < $RemoteAssetEntityTable , i1 . RemoteAssetEntityData > {
@ override
final i0 . GeneratedDatabase attachedDatabase ;
final String ? _alias ;
$RemoteAssetEntityTable ( this . attachedDatabase , [ this . _alias ] ) ;
2025-07-29 00:34:03 +05:30
static const i0 . VerificationMeta _nameMeta = const i0 . VerificationMeta (
' name ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < String > name = i0 . GeneratedColumn < String > (
2025-07-29 00:34:03 +05:30
' name ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: true ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumnWithTypeConverter < i2 . AssetType , int > type =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < int > (
' type ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . int ,
requiredDuringInsert: true ,
) . withConverter < i2 . AssetType > ( i1 . $RemoteAssetEntityTable . $convertertype ) ;
static const i0 . VerificationMeta _createdAtMeta = const i0 . VerificationMeta (
' createdAt ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < DateTime > createdAt =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < DateTime > (
' created_at ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . dateTime ,
requiredDuringInsert: false ,
defaultValue: i4 . currentDateAndTime ,
) ;
static const i0 . VerificationMeta _updatedAtMeta = const i0 . VerificationMeta (
' updatedAt ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < DateTime > updatedAt =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < DateTime > (
' updated_at ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . dateTime ,
requiredDuringInsert: false ,
defaultValue: i4 . currentDateAndTime ,
) ;
static const i0 . VerificationMeta _widthMeta = const i0 . VerificationMeta (
' width ' ,
) ;
2025-06-09 08:20:54 +05:30
@ override
late final i0 . GeneratedColumn < int > width = i0 . GeneratedColumn < int > (
2025-07-29 00:34:03 +05:30
' width ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . int ,
requiredDuringInsert: false ,
) ;
static const i0 . VerificationMeta _heightMeta = const i0 . VerificationMeta (
' height ' ,
) ;
2025-06-09 08:20:54 +05:30
@ override
late final i0 . GeneratedColumn < int > height = i0 . GeneratedColumn < int > (
2025-07-29 00:34:03 +05:30
' height ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . int ,
requiredDuringInsert: false ,
) ;
2025-06-03 21:31:50 +05:30
static const i0 . VerificationMeta _durationInSecondsMeta =
const i0 . VerificationMeta ( ' durationInSeconds ' ) ;
@ override
late final i0 . GeneratedColumn < int > durationInSeconds =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < int > (
' duration_in_seconds ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . int ,
requiredDuringInsert: false ,
) ;
2025-06-03 21:31:50 +05:30
static const i0 . VerificationMeta _idMeta = const i0 . VerificationMeta ( ' id ' ) ;
@ override
late final i0 . GeneratedColumn < String > id = i0 . GeneratedColumn < String > (
2025-07-29 00:34:03 +05:30
' id ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: true ,
) ;
static const i0 . VerificationMeta _checksumMeta = const i0 . VerificationMeta (
' checksum ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < String > checksum = i0 . GeneratedColumn < String > (
2025-07-29 00:34:03 +05:30
' checksum ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: true ,
) ;
static const i0 . VerificationMeta _isFavoriteMeta = const i0 . VerificationMeta (
' isFavorite ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < bool > isFavorite = i0 . GeneratedColumn < bool > (
2025-07-29 00:34:03 +05:30
' is_favorite ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . bool ,
requiredDuringInsert: false ,
defaultConstraints: i0 . GeneratedColumn . constraintIsAlways (
' CHECK ("is_favorite" IN (0, 1)) ' ,
) ,
defaultValue: const i4 . Constant ( false ) ,
) ;
static const i0 . VerificationMeta _ownerIdMeta = const i0 . VerificationMeta (
' ownerId ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < String > ownerId = i0 . GeneratedColumn < String > (
2025-07-29 00:34:03 +05:30
' owner_id ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: true ,
defaultConstraints: i0 . GeneratedColumn . constraintIsAlways (
' REFERENCES user_entity (id) ON DELETE CASCADE ' ,
) ,
) ;
2025-06-03 21:31:50 +05:30
static const i0 . VerificationMeta _localDateTimeMeta =
const i0 . VerificationMeta ( ' localDateTime ' ) ;
@ override
late final i0 . GeneratedColumn < DateTime > localDateTime =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < DateTime > (
' local_date_time ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . dateTime ,
requiredDuringInsert: false ,
) ;
static const i0 . VerificationMeta _thumbHashMeta = const i0 . VerificationMeta (
' thumbHash ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < String > thumbHash = i0 . GeneratedColumn < String > (
2025-07-29 00:34:03 +05:30
' thumb_hash ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: false ,
) ;
static const i0 . VerificationMeta _deletedAtMeta = const i0 . VerificationMeta (
' deletedAt ' ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumn < DateTime > deletedAt =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < DateTime > (
' deleted_at ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . dateTime ,
requiredDuringInsert: false ,
) ;
2025-07-15 00:53:24 +05:30
static const i0 . VerificationMeta _livePhotoVideoIdMeta =
const i0 . VerificationMeta ( ' livePhotoVideoId ' ) ;
@ override
late final i0 . GeneratedColumn < String > livePhotoVideoId =
2025-07-29 00:34:03 +05:30
i0 . GeneratedColumn < String > (
' live_photo_video_id ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: false ,
) ;
2025-06-03 21:31:50 +05:30
@ override
late final i0 . GeneratedColumnWithTypeConverter < i2 . AssetVisibility , int >
2025-07-29 00:34:03 +05:30
visibility =
i0 . GeneratedColumn < int > (
' visibility ' ,
aliasedName ,
false ,
type: i0 . DriftSqlType . int ,
requiredDuringInsert: true ,
) . withConverter < i2 . AssetVisibility > (
i1 . $RemoteAssetEntityTable . $convertervisibility ,
) ;
static const i0 . VerificationMeta _stackIdMeta = const i0 . VerificationMeta (
' stackId ' ,
) ;
2025-07-18 10:01:04 +05:30
@ override
late final i0 . GeneratedColumn < String > stackId = i0 . GeneratedColumn < String > (
2025-07-29 00:34:03 +05:30
' stack_id ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: false ,
) ;
2025-07-30 23:59:00 +05:30
static const i0 . VerificationMeta _libraryIdMeta = const i0 . VerificationMeta (
' libraryId ' ,
) ;
@ override
late final i0 . GeneratedColumn < String > libraryId = i0 . GeneratedColumn < String > (
' library_id ' ,
aliasedName ,
true ,
type: i0 . DriftSqlType . string ,
requiredDuringInsert: false ,
) ;
2025-06-03 21:31:50 +05:30
@ override
List < i0 . GeneratedColumn > get $columns = > [
2025-07-29 00:34:03 +05:30
name ,
type ,
createdAt ,
updatedAt ,
width ,
height ,
durationInSeconds ,
id ,
checksum ,
isFavorite ,
ownerId ,
localDateTime ,
thumbHash ,
deletedAt ,
livePhotoVideoId ,
visibility ,
stackId ,
2025-07-30 23:59:00 +05:30
libraryId ,
2025-07-29 00:34:03 +05:30
] ;
2025-06-03 21:31:50 +05:30
@ override
String get aliasedName = > _alias ? ? actualTableName ;
@ override
String get actualTableName = > $name ;
static const String $name = ' remote_asset_entity ' ;
@ override
i0 . VerificationContext validateIntegrity (
2025-07-29 00:34:03 +05:30
i0 . Insertable < i1 . RemoteAssetEntityData > instance , {
bool isInserting = false ,
} ) {
2025-06-03 21:31:50 +05:30
final context = i0 . VerificationContext ( ) ;
final data = instance . toColumns ( true ) ;
if ( data . containsKey ( ' name ' ) ) {
context . handle (
2025-07-29 00:34:03 +05:30
_nameMeta ,
name . isAcceptableOrUnknown ( data [ ' name ' ] ! , _nameMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
} else if ( isInserting ) {
context . missing ( _nameMeta ) ;
}
if ( data . containsKey ( ' created_at ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_createdAtMeta ,
createdAt . isAcceptableOrUnknown ( data [ ' created_at ' ] ! , _createdAtMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
}
if ( data . containsKey ( ' updated_at ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_updatedAtMeta ,
updatedAt . isAcceptableOrUnknown ( data [ ' updated_at ' ] ! , _updatedAtMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
}
2025-06-09 08:20:54 +05:30
if ( data . containsKey ( ' width ' ) ) {
context . handle (
2025-07-29 00:34:03 +05:30
_widthMeta ,
width . isAcceptableOrUnknown ( data [ ' width ' ] ! , _widthMeta ) ,
) ;
2025-06-09 08:20:54 +05:30
}
if ( data . containsKey ( ' height ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_heightMeta ,
height . isAcceptableOrUnknown ( data [ ' height ' ] ! , _heightMeta ) ,
) ;
2025-06-09 08:20:54 +05:30
}
2025-06-03 21:31:50 +05:30
if ( data . containsKey ( ' duration_in_seconds ' ) ) {
context . handle (
2025-07-29 00:34:03 +05:30
_durationInSecondsMeta ,
durationInSeconds . isAcceptableOrUnknown (
data [ ' duration_in_seconds ' ] ! ,
2025-06-03 21:31:50 +05:30
_durationInSecondsMeta ,
2025-07-29 00:34:03 +05:30
) ,
) ;
2025-06-03 21:31:50 +05:30
}
if ( data . containsKey ( ' id ' ) ) {
context . handle ( _idMeta , id . isAcceptableOrUnknown ( data [ ' id ' ] ! , _idMeta ) ) ;
} else if ( isInserting ) {
context . missing ( _idMeta ) ;
}
if ( data . containsKey ( ' checksum ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_checksumMeta ,
checksum . isAcceptableOrUnknown ( data [ ' checksum ' ] ! , _checksumMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
} else if ( isInserting ) {
context . missing ( _checksumMeta ) ;
}
if ( data . containsKey ( ' is_favorite ' ) ) {
context . handle (
2025-07-29 00:34:03 +05:30
_isFavoriteMeta ,
isFavorite . isAcceptableOrUnknown ( data [ ' is_favorite ' ] ! , _isFavoriteMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
}
if ( data . containsKey ( ' owner_id ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_ownerIdMeta ,
ownerId . isAcceptableOrUnknown ( data [ ' owner_id ' ] ! , _ownerIdMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
} else if ( isInserting ) {
context . missing ( _ownerIdMeta ) ;
}
if ( data . containsKey ( ' local_date_time ' ) ) {
context . handle (
2025-07-29 00:34:03 +05:30
_localDateTimeMeta ,
localDateTime . isAcceptableOrUnknown (
data [ ' local_date_time ' ] ! ,
2025-06-03 21:31:50 +05:30
_localDateTimeMeta ,
2025-07-29 00:34:03 +05:30
) ,
) ;
2025-06-03 21:31:50 +05:30
}
if ( data . containsKey ( ' thumb_hash ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_thumbHashMeta ,
thumbHash . isAcceptableOrUnknown ( data [ ' thumb_hash ' ] ! , _thumbHashMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
}
if ( data . containsKey ( ' deleted_at ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_deletedAtMeta ,
deletedAt . isAcceptableOrUnknown ( data [ ' deleted_at ' ] ! , _deletedAtMeta ) ,
) ;
2025-06-03 21:31:50 +05:30
}
2025-07-15 00:53:24 +05:30
if ( data . containsKey ( ' live_photo_video_id ' ) ) {
context . handle (
2025-07-29 00:34:03 +05:30
_livePhotoVideoIdMeta ,
livePhotoVideoId . isAcceptableOrUnknown (
data [ ' live_photo_video_id ' ] ! ,
2025-07-15 00:53:24 +05:30
_livePhotoVideoIdMeta ,
2025-07-29 00:34:03 +05:30
) ,
) ;
2025-07-15 00:53:24 +05:30
}
2025-07-18 10:01:04 +05:30
if ( data . containsKey ( ' stack_id ' ) ) {
2025-07-29 00:34:03 +05:30
context . handle (
_stackIdMeta ,
stackId . isAcceptableOrUnknown ( data [ ' stack_id ' ] ! , _stackIdMeta ) ,
) ;
2025-07-18 10:01:04 +05:30
}
2025-07-30 23:59:00 +05:30
if ( data . containsKey ( ' library_id ' ) ) {
context . handle (
_libraryIdMeta ,
libraryId . isAcceptableOrUnknown ( data [ ' library_id ' ] ! , _libraryIdMeta ) ,
) ;
}
2025-06-03 21:31:50 +05:30
return context ;
}
@ override
Set < i0 . GeneratedColumn > get $primaryKey = > { id } ;
@ override
2025-07-29 00:34:03 +05:30
i1 . RemoteAssetEntityData map (
Map < String , dynamic > data , {
String ? tablePrefix ,
} ) {
2025-06-03 21:31:50 +05:30
final effectivePrefix = tablePrefix ! = null ? ' $ tablePrefix . ' : ' ' ;
return i1 . RemoteAssetEntityData (
2025-07-29 00:34:03 +05:30
name: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } name ' ] ,
) ! ,
type: i1 . $RemoteAssetEntityTable . $convertertype . fromSql (
attachedDatabase . typeMapping . read (
i0 . DriftSqlType . int ,
data [ ' ${ effectivePrefix } type ' ] ,
) ! ,
) ,
2025-06-03 21:31:50 +05:30
createdAt: attachedDatabase . typeMapping . read (
2025-07-29 00:34:03 +05:30
i0 . DriftSqlType . dateTime ,
data [ ' ${ effectivePrefix } created_at ' ] ,
) ! ,
2025-06-03 21:31:50 +05:30
updatedAt: attachedDatabase . typeMapping . read (
2025-07-29 00:34:03 +05:30
i0 . DriftSqlType . dateTime ,
data [ ' ${ effectivePrefix } updated_at ' ] ,
) ! ,
width: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . int ,
data [ ' ${ effectivePrefix } width ' ] ,
) ,
height: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . int ,
data [ ' ${ effectivePrefix } height ' ] ,
) ,
2025-06-03 21:31:50 +05:30
durationInSeconds: attachedDatabase . typeMapping . read (
2025-07-29 00:34:03 +05:30
i0 . DriftSqlType . int ,
data [ ' ${ effectivePrefix } duration_in_seconds ' ] ,
) ,
id: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } id ' ] ,
) ! ,
checksum: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } checksum ' ] ,
) ! ,
isFavorite: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . bool ,
data [ ' ${ effectivePrefix } is_favorite ' ] ,
) ! ,
ownerId: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } owner_id ' ] ,
) ! ,
2025-06-03 21:31:50 +05:30
localDateTime: attachedDatabase . typeMapping . read (
2025-07-29 00:34:03 +05:30
i0 . DriftSqlType . dateTime ,
data [ ' ${ effectivePrefix } local_date_time ' ] ,
) ,
thumbHash: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } thumb_hash ' ] ,
) ,
deletedAt: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . dateTime ,
data [ ' ${ effectivePrefix } deleted_at ' ] ,
) ,
2025-07-15 00:53:24 +05:30
livePhotoVideoId: attachedDatabase . typeMapping . read (
2025-07-29 00:34:03 +05:30
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } live_photo_video_id ' ] ,
) ,
2025-06-03 21:31:50 +05:30
visibility: i1 . $RemoteAssetEntityTable . $convertervisibility . fromSql (
2025-07-29 00:34:03 +05:30
attachedDatabase . typeMapping . read (
i0 . DriftSqlType . int ,
data [ ' ${ effectivePrefix } visibility ' ] ,
) ! ,
) ,
stackId: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } stack_id ' ] ,
) ,
2025-07-30 23:59:00 +05:30
libraryId: attachedDatabase . typeMapping . read (
i0 . DriftSqlType . string ,
data [ ' ${ effectivePrefix } library_id ' ] ,
) ,
2025-06-03 21:31:50 +05:30
) ;
}
@ override
$RemoteAssetEntityTable createAlias ( String alias ) {
return $RemoteAssetEntityTable ( attachedDatabase , alias ) ;
}
static i0 . JsonTypeConverter2 < i2 . AssetType , int , int > $convertertype =
const i0 . EnumIndexConverter < i2 . AssetType > ( i2 . AssetType . values ) ;
static i0 . JsonTypeConverter2 < i2 . AssetVisibility , int , int >
2025-07-29 00:34:03 +05:30
$convertervisibility = const i0 . EnumIndexConverter < i2 . AssetVisibility > (
i2 . AssetVisibility . values ,
) ;
2025-06-03 21:31:50 +05:30
@ override
bool get withoutRowId = > true ;
@ override
bool get isStrict = > true ;
}
class RemoteAssetEntityData extends i0 . DataClass
implements i0 . Insertable < i1 . RemoteAssetEntityData > {
final String name ;
final i2 . AssetType type ;
final DateTime createdAt ;
final DateTime updatedAt ;
2025-06-09 08:20:54 +05:30
final int ? width ;
final int ? height ;
2025-06-03 21:31:50 +05:30
final int ? durationInSeconds ;
final String id ;
final String checksum ;
final bool isFavorite ;
final String ownerId ;
final DateTime ? localDateTime ;
final String ? thumbHash ;
final DateTime ? deletedAt ;
2025-07-15 00:53:24 +05:30
final String ? livePhotoVideoId ;
2025-06-03 21:31:50 +05:30
final i2 . AssetVisibility visibility ;
2025-07-18 10:01:04 +05:30
final String ? stackId ;
2025-07-30 23:59:00 +05:30
final String ? libraryId ;
2025-07-29 00:34:03 +05:30
const RemoteAssetEntityData ( {
required this . name ,
required this . type ,
required this . createdAt ,
required this . updatedAt ,
this . width ,
this . height ,
this . durationInSeconds ,
required this . id ,
required this . checksum ,
required this . isFavorite ,
required this . ownerId ,
this . localDateTime ,
this . thumbHash ,
this . deletedAt ,
this . livePhotoVideoId ,
required this . visibility ,
this . stackId ,
2025-07-30 23:59:00 +05:30
this . libraryId ,
2025-07-29 00:34:03 +05:30
} ) ;
2025-06-03 21:31:50 +05:30
@ override
Map < String , i0 . Expression > toColumns ( bool nullToAbsent ) {
final map = < String , i0 . Expression > { } ;
map [ ' name ' ] = i0 . Variable < String > ( name ) ;
{
map [ ' type ' ] = i0 . Variable < int > (
2025-07-29 00:34:03 +05:30
i1 . $RemoteAssetEntityTable . $convertertype . toSql ( type ) ,
) ;
2025-06-03 21:31:50 +05:30
}
map [ ' created_at ' ] = i0 . Variable < DateTime > ( createdAt ) ;
map [ ' updated_at ' ] = i0 . Variable < DateTime > ( updatedAt ) ;
2025-06-09 08:20:54 +05:30
if ( ! nullToAbsent | | width ! = null ) {
map [ ' width ' ] = i0 . Variable < int > ( width ) ;
}
if ( ! nullToAbsent | | height ! = null ) {
map [ ' height ' ] = i0 . Variable < int > ( height ) ;
}
2025-06-03 21:31:50 +05:30
if ( ! nullToAbsent | | durationInSeconds ! = null ) {
map [ ' duration_in_seconds ' ] = i0 . Variable < int > ( durationInSeconds ) ;
}
map [ ' id ' ] = i0 . Variable < String > ( id ) ;
map [ ' checksum ' ] = i0 . Variable < String > ( checksum ) ;
map [ ' is_favorite ' ] = i0 . Variable < bool > ( isFavorite ) ;
map [ ' owner_id ' ] = i0 . Variable < String > ( ownerId ) ;
if ( ! nullToAbsent | | localDateTime ! = null ) {
map [ ' local_date_time ' ] = i0 . Variable < DateTime > ( localDateTime ) ;
}
if ( ! nullToAbsent | | thumbHash ! = null ) {
map [ ' thumb_hash ' ] = i0 . Variable < String > ( thumbHash ) ;
}
if ( ! nullToAbsent | | deletedAt ! = null ) {
map [ ' deleted_at ' ] = i0 . Variable < DateTime > ( deletedAt ) ;
}
2025-07-15 00:53:24 +05:30
if ( ! nullToAbsent | | livePhotoVideoId ! = null ) {
map [ ' live_photo_video_id ' ] = i0 . Variable < String > ( livePhotoVideoId ) ;
}
2025-06-03 21:31:50 +05:30
{
map [ ' visibility ' ] = i0 . Variable < int > (
2025-07-29 00:34:03 +05:30
i1 . $RemoteAssetEntityTable . $convertervisibility . toSql ( visibility ) ,
) ;
2025-06-03 21:31:50 +05:30
}
2025-07-18 10:01:04 +05:30
if ( ! nullToAbsent | | stackId ! = null ) {
map [ ' stack_id ' ] = i0 . Variable < String > ( stackId ) ;
}
2025-07-30 23:59:00 +05:30
if ( ! nullToAbsent | | libraryId ! = null ) {
map [ ' library_id ' ] = i0 . Variable < String > ( libraryId ) ;
}
2025-06-03 21:31:50 +05:30
return map ;
}
2025-07-29 00:34:03 +05:30
factory RemoteAssetEntityData . fromJson (
Map < String , dynamic > json , {
i0 . ValueSerializer ? serializer ,
} ) {
2025-06-03 21:31:50 +05:30
serializer ? ? = i0 . driftRuntimeOptions . defaultSerializer ;
return RemoteAssetEntityData (
name: serializer . fromJson < String > ( json [ ' name ' ] ) ,
2025-07-29 00:34:03 +05:30
type: i1 . $RemoteAssetEntityTable . $convertertype . fromJson (
serializer . fromJson < int > ( json [ ' type ' ] ) ,
) ,
2025-06-03 21:31:50 +05:30
createdAt: serializer . fromJson < DateTime > ( json [ ' createdAt ' ] ) ,
updatedAt: serializer . fromJson < DateTime > ( json [ ' updatedAt ' ] ) ,
2025-06-09 08:20:54 +05:30
width: serializer . fromJson < int ? > ( json [ ' width ' ] ) ,
height: serializer . fromJson < int ? > ( json [ ' height ' ] ) ,
2025-06-03 21:31:50 +05:30
durationInSeconds: serializer . fromJson < int ? > ( json [ ' durationInSeconds ' ] ) ,
id: serializer . fromJson < String > ( json [ ' id ' ] ) ,
checksum: serializer . fromJson < String > ( json [ ' checksum ' ] ) ,
isFavorite: serializer . fromJson < bool > ( json [ ' isFavorite ' ] ) ,
ownerId: serializer . fromJson < String > ( json [ ' ownerId ' ] ) ,
localDateTime: serializer . fromJson < DateTime ? > ( json [ ' localDateTime ' ] ) ,
thumbHash: serializer . fromJson < String ? > ( json [ ' thumbHash ' ] ) ,
deletedAt: serializer . fromJson < DateTime ? > ( json [ ' deletedAt ' ] ) ,
2025-07-15 00:53:24 +05:30
livePhotoVideoId: serializer . fromJson < String ? > ( json [ ' livePhotoVideoId ' ] ) ,
2025-07-29 00:34:03 +05:30
visibility: i1 . $RemoteAssetEntityTable . $convertervisibility . fromJson (
serializer . fromJson < int > ( json [ ' visibility ' ] ) ,
) ,
2025-07-18 10:01:04 +05:30
stackId: serializer . fromJson < String ? > ( json [ ' stackId ' ] ) ,
2025-07-30 23:59:00 +05:30
libraryId: serializer . fromJson < String ? > ( json [ ' libraryId ' ] ) ,
2025-06-03 21:31:50 +05:30
) ;
}
@ override
Map < String , dynamic > toJson ( { i0 . ValueSerializer ? serializer } ) {
serializer ? ? = i0 . driftRuntimeOptions . defaultSerializer ;
return < String , dynamic > {
' name ' : serializer . toJson < String > ( name ) ,
2025-07-29 00:34:03 +05:30
' type ' : serializer . toJson < int > (
i1 . $RemoteAssetEntityTable . $convertertype . toJson ( type ) ,
) ,
2025-06-03 21:31:50 +05:30
' createdAt ' : serializer . toJson < DateTime > ( createdAt ) ,
' updatedAt ' : serializer . toJson < DateTime > ( updatedAt ) ,
2025-06-09 08:20:54 +05:30
' width ' : serializer . toJson < int ? > ( width ) ,
' height ' : serializer . toJson < int ? > ( height ) ,
2025-06-03 21:31:50 +05:30
' durationInSeconds ' : serializer . toJson < int ? > ( durationInSeconds ) ,
' id ' : serializer . toJson < String > ( id ) ,
' checksum ' : serializer . toJson < String > ( checksum ) ,
' isFavorite ' : serializer . toJson < bool > ( isFavorite ) ,
' ownerId ' : serializer . toJson < String > ( ownerId ) ,
' localDateTime ' : serializer . toJson < DateTime ? > ( localDateTime ) ,
' thumbHash ' : serializer . toJson < String ? > ( thumbHash ) ,
' deletedAt ' : serializer . toJson < DateTime ? > ( deletedAt ) ,
2025-07-15 00:53:24 +05:30
' livePhotoVideoId ' : serializer . toJson < String ? > ( livePhotoVideoId ) ,
2025-06-03 21:31:50 +05:30
' visibility ' : serializer . toJson < int > (
2025-07-29 00:34:03 +05:30
i1 . $RemoteAssetEntityTable . $convertervisibility . toJson ( visibility ) ,
) ,
2025-07-18 10:01:04 +05:30
' stackId ' : serializer . toJson < String ? > ( stackId ) ,
2025-07-30 23:59:00 +05:30
' libraryId ' : serializer . toJson < String ? > ( libraryId ) ,
2025-06-03 21:31:50 +05:30
} ;
}
2025-07-29 00:34:03 +05:30
i1 . RemoteAssetEntityData copyWith ( {
String ? name ,
i2 . AssetType ? type ,
DateTime ? createdAt ,
DateTime ? updatedAt ,
i0 . Value < int ? > width = const i0 . Value . absent ( ) ,
i0 . Value < int ? > height = const i0 . Value . absent ( ) ,
i0 . Value < int ? > durationInSeconds = const i0 . Value . absent ( ) ,
String ? id ,
String ? checksum ,
bool ? isFavorite ,
String ? ownerId ,
i0 . Value < DateTime ? > localDateTime = const i0 . Value . absent ( ) ,
i0 . Value < String ? > thumbHash = const i0 . Value . absent ( ) ,
i0 . Value < DateTime ? > deletedAt = const i0 . Value . absent ( ) ,
i0 . Value < String ? > livePhotoVideoId = const i0 . Value . absent ( ) ,
i2 . AssetVisibility ? visibility ,
i0 . Value < String ? > stackId = const i0 . Value . absent ( ) ,
2025-07-30 23:59:00 +05:30
i0 . Value < String ? > libraryId = const i0 . Value . absent ( ) ,
2025-07-29 00:34:03 +05:30
} ) = > i1 . RemoteAssetEntityData (
name: name ? ? this . name ,
type: type ? ? this . type ,
createdAt: createdAt ? ? this . createdAt ,
updatedAt: updatedAt ? ? this . updatedAt ,
width: width . present ? width . value : this . width ,
height: height . present ? height . value : this . height ,
durationInSeconds: durationInSeconds . present
? durationInSeconds . value
: this . durationInSeconds ,
id: id ? ? this . id ,
checksum: checksum ? ? this . checksum ,
isFavorite: isFavorite ? ? this . isFavorite ,
ownerId: ownerId ? ? this . ownerId ,
localDateTime: localDateTime . present
? localDateTime . value
: this . localDateTime ,
thumbHash: thumbHash . present ? thumbHash . value : this . thumbHash ,
deletedAt: deletedAt . present ? deletedAt . value : this . deletedAt ,
livePhotoVideoId: livePhotoVideoId . present
? livePhotoVideoId . value
: this . livePhotoVideoId ,
visibility: visibility ? ? this . visibility ,
stackId: stackId . present ? stackId . value : this . stackId ,
2025-07-30 23:59:00 +05:30
libraryId: libraryId . present ? libraryId . value : this . libraryId ,
2025-07-29 00:34:03 +05:30
) ;
2025-06-03 21:31:50 +05:30
RemoteAssetEntityData copyWithCompanion ( i1 . RemoteAssetEntityCompanion data ) {
return RemoteAssetEntityData (
name: data . name . present ? data . name . value : this . name ,
type: data . type . present ? data . type . value : this . type ,
createdAt: data . createdAt . present ? data . createdAt . value : this . createdAt ,
updatedAt: data . updatedAt . present ? data . updatedAt . value : this . updatedAt ,
2025-06-09 08:20:54 +05:30
width: data . width . present ? data . width . value : this . width ,
height: data . height . present ? data . height . value : this . height ,
2025-06-03 21:31:50 +05:30
durationInSeconds: data . durationInSeconds . present
? data . durationInSeconds . value
: this . durationInSeconds ,
id: data . id . present ? data . id . value : this . id ,
checksum: data . checksum . present ? data . checksum . value : this . checksum ,
2025-07-29 00:34:03 +05:30
isFavorite: data . isFavorite . present
? data . isFavorite . value
: this . isFavorite ,
2025-06-03 21:31:50 +05:30
ownerId: data . ownerId . present ? data . ownerId . value : this . ownerId ,
localDateTime: data . localDateTime . present
? data . localDateTime . value
: this . localDateTime ,
thumbHash: data . thumbHash . present ? data . thumbHash . value : this . thumbHash ,
deletedAt: data . deletedAt . present ? data . deletedAt . value : this . deletedAt ,
2025-07-15 00:53:24 +05:30
livePhotoVideoId: data . livePhotoVideoId . present
? data . livePhotoVideoId . value
: this . livePhotoVideoId ,
2025-07-29 00:34:03 +05:30
visibility: data . visibility . present
? data . visibility . value
: this . visibility ,
2025-07-18 10:01:04 +05:30
stackId: data . stackId . present ? data . stackId . value : this . stackId ,
2025-07-30 23:59:00 +05:30
libraryId: data . libraryId . present ? data . libraryId . value : this . libraryId ,
2025-06-03 21:31:50 +05:30
) ;
}
@ override
String toString ( ) {
return ( StringBuffer ( ' RemoteAssetEntityData( ' )
. . write ( ' name: $ name , ' )
. . write ( ' type: $ type , ' )
. . write ( ' createdAt: $ createdAt , ' )
. . write ( ' updatedAt: $ updatedAt , ' )
2025-06-09 08:20:54 +05:30
. . write ( ' width: $ width , ' )
. . write ( ' height: $ height , ' )
2025-06-03 21:31:50 +05:30
. . write ( ' durationInSeconds: $ durationInSeconds , ' )
. . write ( ' id: $ id , ' )
. . write ( ' checksum: $ checksum , ' )
. . write ( ' isFavorite: $ isFavorite , ' )
. . write ( ' ownerId: $ ownerId , ' )
. . write ( ' localDateTime: $ localDateTime , ' )
. . write ( ' thumbHash: $ thumbHash , ' )
. . write ( ' deletedAt: $ deletedAt , ' )
2025-07-15 00:53:24 +05:30
. . write ( ' livePhotoVideoId: $ livePhotoVideoId , ' )
2025-07-18 10:01:04 +05:30
. . write ( ' visibility: $ visibility , ' )
2025-07-30 23:59:00 +05:30
. . write ( ' stackId: $ stackId , ' )
. . write ( ' libraryId: $ libraryId ' )
2025-06-03 21:31:50 +05:30
. . write ( ' ) ' ) )
. toString ( ) ;
}
@ override
int get hashCode = > Object . hash (
2025-07-29 00:34:03 +05:30
name ,
type ,
createdAt ,
updatedAt ,
width ,
height ,
durationInSeconds ,
id ,
checksum ,
isFavorite ,
ownerId ,
localDateTime ,
thumbHash ,
deletedAt ,
livePhotoVideoId ,
visibility ,
stackId ,
2025-07-30 23:59:00 +05:30
libraryId ,
2025-07-29 00:34:03 +05:30
) ;
2025-06-03 21:31:50 +05:30
@ override
bool operator = = ( Object other ) = >
identical ( this , other ) | |
( other is i1 . RemoteAssetEntityData & &
other . name = = this . name & &
other . type = = this . type & &
other . createdAt = = this . createdAt & &
other . updatedAt = = this . updatedAt & &
2025-06-09 08:20:54 +05:30
other . width = = this . width & &
other . height = = this . height & &
2025-06-03 21:31:50 +05:30
other . durationInSeconds = = this . durationInSeconds & &
other . id = = this . id & &
other . checksum = = this . checksum & &
other . isFavorite = = this . isFavorite & &
other . ownerId = = this . ownerId & &
other . localDateTime = = this . localDateTime & &
other . thumbHash = = this . thumbHash & &
other . deletedAt = = this . deletedAt & &
2025-07-15 00:53:24 +05:30
other . livePhotoVideoId = = this . livePhotoVideoId & &
2025-07-18 10:01:04 +05:30
other . visibility = = this . visibility & &
2025-07-30 23:59:00 +05:30
other . stackId = = this . stackId & &
other . libraryId = = this . libraryId ) ;
2025-06-03 21:31:50 +05:30
}
class RemoteAssetEntityCompanion
extends i0 . UpdateCompanion < i1 . RemoteAssetEntityData > {
final i0 . Value < String > name ;
final i0 . Value < i2 . AssetType > type ;
final i0 . Value < DateTime > createdAt ;
final i0 . Value < DateTime > updatedAt ;
2025-06-09 08:20:54 +05:30
final i0 . Value < int ? > width ;
final i0 . Value < int ? > height ;
2025-06-03 21:31:50 +05:30
final i0 . Value < int ? > durationInSeconds ;
final i0 . Value < String > id ;
final i0 . Value < String > checksum ;
final i0 . Value < bool > isFavorite ;
final i0 . Value < String > ownerId ;
final i0 . Value < DateTime ? > localDateTime ;
final i0 . Value < String ? > thumbHash ;
final i0 . Value < DateTime ? > deletedAt ;
2025-07-15 00:53:24 +05:30
final i0 . Value < String ? > livePhotoVideoId ;
2025-06-03 21:31:50 +05:30
final i0 . Value < i2 . AssetVisibility > visibility ;
2025-07-18 10:01:04 +05:30
final i0 . Value < String ? > stackId ;
2025-07-30 23:59:00 +05:30
final i0 . Value < String ? > libraryId ;
2025-06-03 21:31:50 +05:30
const RemoteAssetEntityCompanion ( {
this . name = const i0 . Value . absent ( ) ,
this . type = const i0 . Value . absent ( ) ,
this . createdAt = const i0 . Value . absent ( ) ,
this . updatedAt = const i0 . Value . absent ( ) ,
2025-06-09 08:20:54 +05:30
this . width = const i0 . Value . absent ( ) ,
this . height = const i0 . Value . absent ( ) ,
2025-06-03 21:31:50 +05:30
this . durationInSeconds = const i0 . Value . absent ( ) ,
this . id = const i0 . Value . absent ( ) ,
this . checksum = const i0 . Value . absent ( ) ,
this . isFavorite = const i0 . Value . absent ( ) ,
this . ownerId = const i0 . Value . absent ( ) ,
this . localDateTime = const i0 . Value . absent ( ) ,
this . thumbHash = const i0 . Value . absent ( ) ,
this . deletedAt = const i0 . Value . absent ( ) ,
2025-07-15 00:53:24 +05:30
this . livePhotoVideoId = const i0 . Value . absent ( ) ,
2025-06-03 21:31:50 +05:30
this . visibility = const i0 . Value . absent ( ) ,
2025-07-18 10:01:04 +05:30
this . stackId = const i0 . Value . absent ( ) ,
2025-07-30 23:59:00 +05:30
this . libraryId = const i0 . Value . absent ( ) ,
2025-06-03 21:31:50 +05:30
} ) ;
RemoteAssetEntityCompanion . insert ( {
required String name ,
required i2 . AssetType type ,
this . createdAt = const i0 . Value . absent ( ) ,
this . updatedAt = const i0 . Value . absent ( ) ,
2025-06-09 08:20:54 +05:30
this . width = const i0 . Value . absent ( ) ,
this . height = const i0 . Value . absent ( ) ,
2025-06-03 21:31:50 +05:30
this . durationInSeconds = const i0 . Value . absent ( ) ,
required String id ,
required String checksum ,
this . isFavorite = const i0 . Value . absent ( ) ,
required String ownerId ,
this . localDateTime = const i0 . Value . absent ( ) ,
this . thumbHash = const i0 . Value . absent ( ) ,
this . deletedAt = const i0 . Value . absent ( ) ,
2025-07-15 00:53:24 +05:30
this . livePhotoVideoId = const i0 . Value . absent ( ) ,
2025-06-03 21:31:50 +05:30
required i2 . AssetVisibility visibility ,
2025-07-18 10:01:04 +05:30
this . stackId = const i0 . Value . absent ( ) ,
2025-07-30 23:59:00 +05:30
this . libraryId = const i0 . Value . absent ( ) ,
2025-07-29 00:34:03 +05:30
} ) : name = i0 . Value ( name ) ,
type = i0 . Value ( type ) ,
id = i0 . Value ( id ) ,
checksum = i0 . Value ( checksum ) ,
ownerId = i0 . Value ( ownerId ) ,
visibility = i0 . Value ( visibility ) ;
2025-06-03 21:31:50 +05:30
static i0 . Insertable < i1 . RemoteAssetEntityData > custom ( {
i0 . Expression < String > ? name ,
i0 . Expression < int > ? type ,
i0 . Expression < DateTime > ? createdAt ,
i0 . Expression < DateTime > ? updatedAt ,
2025-06-09 08:20:54 +05:30
i0 . Expression < int > ? width ,
i0 . Expression < int > ? height ,
2025-06-03 21:31:50 +05:30
i0 . Expression < int > ? durationInSeconds ,
i0 . Expression < String > ? id ,
i0 . Expression < String > ? checksum ,
i0 . Expression < bool > ? isFavorite ,
i0 . Expression < String > ? ownerId ,
i0 . Expression < DateTime > ? localDateTime ,
i0 . Expression < String > ? thumbHash ,
i0 . Expression < DateTime > ? deletedAt ,
2025-07-15 00:53:24 +05:30
i0 . Expression < String > ? livePhotoVideoId ,
2025-06-03 21:31:50 +05:30
i0 . Expression < int > ? visibility ,
2025-07-18 10:01:04 +05:30
i0 . Expression < String > ? stackId ,
2025-07-30 23:59:00 +05:30
i0 . Expression < String > ? libraryId ,
2025-06-03 21:31:50 +05:30
} ) {
return i0 . RawValuesInsertable ( {
if ( name ! = null ) ' name ' : name ,
if ( type ! = null ) ' type ' : type ,
if ( createdAt ! = null ) ' created_at ' : createdAt ,
if ( updatedAt ! = null ) ' updated_at ' : updatedAt ,
2025-06-09 08:20:54 +05:30
if ( width ! = null ) ' width ' : width ,
if ( height ! = null ) ' height ' : height ,
2025-06-03 21:31:50 +05:30
if ( durationInSeconds ! = null ) ' duration_in_seconds ' : durationInSeconds ,
if ( id ! = null ) ' id ' : id ,
if ( checksum ! = null ) ' checksum ' : checksum ,
if ( isFavorite ! = null ) ' is_favorite ' : isFavorite ,
if ( ownerId ! = null ) ' owner_id ' : ownerId ,
if ( localDateTime ! = null ) ' local_date_time ' : localDateTime ,
if ( thumbHash ! = null ) ' thumb_hash ' : thumbHash ,
if ( deletedAt ! = null ) ' deleted_at ' : deletedAt ,
2025-07-15 00:53:24 +05:30
if ( livePhotoVideoId ! = null ) ' live_photo_video_id ' : livePhotoVideoId ,
2025-06-03 21:31:50 +05:30
if ( visibility ! = null ) ' visibility ' : visibility ,
2025-07-18 10:01:04 +05:30
if ( stackId ! = null ) ' stack_id ' : stackId ,
2025-07-30 23:59:00 +05:30
if ( libraryId ! = null ) ' library_id ' : libraryId ,
2025-06-03 21:31:50 +05:30
} ) ;
}
2025-07-29 00:34:03 +05:30
i1 . RemoteAssetEntityCompanion copyWith ( {
i0 . Value < String > ? name ,
i0 . Value < i2 . AssetType > ? type ,
i0 . Value < DateTime > ? createdAt ,
i0 . Value < DateTime > ? updatedAt ,
i0 . Value < int ? > ? width ,
i0 . Value < int ? > ? height ,
i0 . Value < int ? > ? durationInSeconds ,
i0 . Value < String > ? id ,
i0 . Value < String > ? checksum ,
i0 . Value < bool > ? isFavorite ,
i0 . Value < String > ? ownerId ,
i0 . Value < DateTime ? > ? localDateTime ,
i0 . Value < String ? > ? thumbHash ,
i0 . Value < DateTime ? > ? deletedAt ,
i0 . Value < String ? > ? livePhotoVideoId ,
i0 . Value < i2 . AssetVisibility > ? visibility ,
i0 . Value < String ? > ? stackId ,
2025-07-30 23:59:00 +05:30
i0 . Value < String ? > ? libraryId ,
2025-07-29 00:34:03 +05:30
} ) {
2025-06-03 21:31:50 +05:30
return i1 . RemoteAssetEntityCompanion (
name: name ? ? this . name ,
type: type ? ? this . type ,
createdAt: createdAt ? ? this . createdAt ,
updatedAt: updatedAt ? ? this . updatedAt ,
2025-06-09 08:20:54 +05:30
width: width ? ? this . width ,
height: height ? ? this . height ,
2025-06-03 21:31:50 +05:30
durationInSeconds: durationInSeconds ? ? this . durationInSeconds ,
id: id ? ? this . id ,
checksum: checksum ? ? this . checksum ,
isFavorite: isFavorite ? ? this . isFavorite ,
ownerId: ownerId ? ? this . ownerId ,
localDateTime: localDateTime ? ? this . localDateTime ,
thumbHash: thumbHash ? ? this . thumbHash ,
deletedAt: deletedAt ? ? this . deletedAt ,
2025-07-15 00:53:24 +05:30
livePhotoVideoId: livePhotoVideoId ? ? this . livePhotoVideoId ,
2025-06-03 21:31:50 +05:30
visibility: visibility ? ? this . visibility ,
2025-07-18 10:01:04 +05:30
stackId: stackId ? ? this . stackId ,
2025-07-30 23:59:00 +05:30
libraryId: libraryId ? ? this . libraryId ,
2025-06-03 21:31:50 +05:30
) ;
}
@ override
Map < String , i0 . Expression > toColumns ( bool nullToAbsent ) {
final map = < String , i0 . Expression > { } ;
if ( name . present ) {
map [ ' name ' ] = i0 . Variable < String > ( name . value ) ;
}
if ( type . present ) {
map [ ' type ' ] = i0 . Variable < int > (
2025-07-29 00:34:03 +05:30
i1 . $RemoteAssetEntityTable . $convertertype . toSql ( type . value ) ,
) ;
2025-06-03 21:31:50 +05:30
}
if ( createdAt . present ) {
map [ ' created_at ' ] = i0 . Variable < DateTime > ( createdAt . value ) ;
}
if ( updatedAt . present ) {
map [ ' updated_at ' ] = i0 . Variable < DateTime > ( updatedAt . value ) ;
}
2025-06-09 08:20:54 +05:30
if ( width . present ) {
map [ ' width ' ] = i0 . Variable < int > ( width . value ) ;
}
if ( height . present ) {
map [ ' height ' ] = i0 . Variable < int > ( height . value ) ;
}
2025-06-03 21:31:50 +05:30
if ( durationInSeconds . present ) {
map [ ' duration_in_seconds ' ] = i0 . Variable < int > ( durationInSeconds . value ) ;
}
if ( id . present ) {
map [ ' id ' ] = i0 . Variable < String > ( id . value ) ;
}
if ( checksum . present ) {
map [ ' checksum ' ] = i0 . Variable < String > ( checksum . value ) ;
}
if ( isFavorite . present ) {
map [ ' is_favorite ' ] = i0 . Variable < bool > ( isFavorite . value ) ;
}
if ( ownerId . present ) {
map [ ' owner_id ' ] = i0 . Variable < String > ( ownerId . value ) ;
}
if ( localDateTime . present ) {
map [ ' local_date_time ' ] = i0 . Variable < DateTime > ( localDateTime . value ) ;
}
if ( thumbHash . present ) {
map [ ' thumb_hash ' ] = i0 . Variable < String > ( thumbHash . value ) ;
}
if ( deletedAt . present ) {
map [ ' deleted_at ' ] = i0 . Variable < DateTime > ( deletedAt . value ) ;
}
2025-07-15 00:53:24 +05:30
if ( livePhotoVideoId . present ) {
map [ ' live_photo_video_id ' ] = i0 . Variable < String > ( livePhotoVideoId . value ) ;
}
2025-06-03 21:31:50 +05:30
if ( visibility . present ) {
2025-07-29 00:34:03 +05:30
map [ ' visibility ' ] = i0 . Variable < int > (
i1 . $RemoteAssetEntityTable . $convertervisibility . toSql ( visibility . value ) ,
) ;
2025-06-03 21:31:50 +05:30
}
2025-07-18 10:01:04 +05:30
if ( stackId . present ) {
map [ ' stack_id ' ] = i0 . Variable < String > ( stackId . value ) ;
}
2025-07-30 23:59:00 +05:30
if ( libraryId . present ) {
map [ ' library_id ' ] = i0 . Variable < String > ( libraryId . value ) ;
}
2025-06-03 21:31:50 +05:30
return map ;
}
@ override
String toString ( ) {
return ( StringBuffer ( ' RemoteAssetEntityCompanion( ' )
. . write ( ' name: $ name , ' )
. . write ( ' type: $ type , ' )
. . write ( ' createdAt: $ createdAt , ' )
. . write ( ' updatedAt: $ updatedAt , ' )
2025-06-09 08:20:54 +05:30
. . write ( ' width: $ width , ' )
. . write ( ' height: $ height , ' )
2025-06-03 21:31:50 +05:30
. . write ( ' durationInSeconds: $ durationInSeconds , ' )
. . write ( ' id: $ id , ' )
. . write ( ' checksum: $ checksum , ' )
. . write ( ' isFavorite: $ isFavorite , ' )
. . write ( ' ownerId: $ ownerId , ' )
. . write ( ' localDateTime: $ localDateTime , ' )
. . write ( ' thumbHash: $ thumbHash , ' )
. . write ( ' deletedAt: $ deletedAt , ' )
2025-07-15 00:53:24 +05:30
. . write ( ' livePhotoVideoId: $ livePhotoVideoId , ' )
2025-07-18 10:01:04 +05:30
. . write ( ' visibility: $ visibility , ' )
2025-07-30 23:59:00 +05:30
. . write ( ' stackId: $ stackId , ' )
. . write ( ' libraryId: $ libraryId ' )
2025-06-03 21:31:50 +05:30
. . write ( ' ) ' ) )
. toString ( ) ;
}
}
2025-06-16 20:37:45 +05:30
2025-07-30 23:59:00 +05:30
i0 . Index get uQRemoteAssetsOwnerChecksum = > i0 . Index (
' UQ_remote_assets_owner_checksum ' ,
' CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL) ' ,
) ;
i0 . Index get uQRemoteAssetsOwnerLibraryChecksum = > i0 . Index (
' UQ_remote_assets_owner_library_checksum ' ,
' CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL) ' ,
) ;
2025-07-29 00:34:03 +05:30
i0 . Index get idxRemoteAssetChecksum = > i0 . Index (
' idx_remote_asset_checksum ' ,
2025-08-07 03:27:33 +05:30
' CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum) ' ,
2025-07-29 00:34:03 +05:30
) ;