feat: add historical data
This commit is contained in:
@@ -3796,6 +3796,270 @@ class ProcessedRemoteCommandsCompanion
|
||||
}
|
||||
}
|
||||
|
||||
class $TabEventsTable extends TabEvents
|
||||
with TableInfo<$TabEventsTable, TabEventRow> {
|
||||
@override
|
||||
final GeneratedDatabase attachedDatabase;
|
||||
final String? _alias;
|
||||
$TabEventsTable(this.attachedDatabase, [this._alias]);
|
||||
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
||||
@override
|
||||
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
||||
'id',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
);
|
||||
static const VerificationMeta _payloadMeta = const VerificationMeta(
|
||||
'payload',
|
||||
);
|
||||
@override
|
||||
late final GeneratedColumn<String> payload = GeneratedColumn<String>(
|
||||
'payload',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
);
|
||||
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
||||
'createdAt',
|
||||
);
|
||||
@override
|
||||
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
||||
'created_at',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.dateTime,
|
||||
requiredDuringInsert: true,
|
||||
);
|
||||
@override
|
||||
List<GeneratedColumn> get $columns => [id, payload, createdAt];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
@override
|
||||
String get actualTableName => $name;
|
||||
static const String $name = 'tab_events';
|
||||
@override
|
||||
VerificationContext validateIntegrity(
|
||||
Insertable<TabEventRow> instance, {
|
||||
bool isInserting = false,
|
||||
}) {
|
||||
final context = VerificationContext();
|
||||
final data = instance.toColumns(true);
|
||||
if (data.containsKey('id')) {
|
||||
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
||||
} else if (isInserting) {
|
||||
context.missing(_idMeta);
|
||||
}
|
||||
if (data.containsKey('payload')) {
|
||||
context.handle(
|
||||
_payloadMeta,
|
||||
payload.isAcceptableOrUnknown(data['payload']!, _payloadMeta),
|
||||
);
|
||||
} else if (isInserting) {
|
||||
context.missing(_payloadMeta);
|
||||
}
|
||||
if (data.containsKey('created_at')) {
|
||||
context.handle(
|
||||
_createdAtMeta,
|
||||
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
||||
);
|
||||
} else if (isInserting) {
|
||||
context.missing(_createdAtMeta);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
@override
|
||||
Set<GeneratedColumn> get $primaryKey => {id};
|
||||
@override
|
||||
TabEventRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return TabEventRow(
|
||||
id: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}id'],
|
||||
)!,
|
||||
payload: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}payload'],
|
||||
)!,
|
||||
createdAt: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}created_at'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
$TabEventsTable createAlias(String alias) {
|
||||
return $TabEventsTable(attachedDatabase, alias);
|
||||
}
|
||||
}
|
||||
|
||||
class TabEventRow extends DataClass implements Insertable<TabEventRow> {
|
||||
/// The event's UUID.
|
||||
final String id;
|
||||
|
||||
/// The event as JSON, exactly as it is sent.
|
||||
final String payload;
|
||||
final DateTime createdAt;
|
||||
const TabEventRow({
|
||||
required this.id,
|
||||
required this.payload,
|
||||
required this.createdAt,
|
||||
});
|
||||
@override
|
||||
Map<String, Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, Expression>{};
|
||||
map['id'] = Variable<String>(id);
|
||||
map['payload'] = Variable<String>(payload);
|
||||
map['created_at'] = Variable<DateTime>(createdAt);
|
||||
return map;
|
||||
}
|
||||
|
||||
TabEventsCompanion toCompanion(bool nullToAbsent) {
|
||||
return TabEventsCompanion(
|
||||
id: Value(id),
|
||||
payload: Value(payload),
|
||||
createdAt: Value(createdAt),
|
||||
);
|
||||
}
|
||||
|
||||
factory TabEventRow.fromJson(
|
||||
Map<String, dynamic> json, {
|
||||
ValueSerializer? serializer,
|
||||
}) {
|
||||
serializer ??= driftRuntimeOptions.defaultSerializer;
|
||||
return TabEventRow(
|
||||
id: serializer.fromJson<String>(json['id']),
|
||||
payload: serializer.fromJson<String>(json['payload']),
|
||||
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
||||
);
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
||||
serializer ??= driftRuntimeOptions.defaultSerializer;
|
||||
return <String, dynamic>{
|
||||
'id': serializer.toJson<String>(id),
|
||||
'payload': serializer.toJson<String>(payload),
|
||||
'createdAt': serializer.toJson<DateTime>(createdAt),
|
||||
};
|
||||
}
|
||||
|
||||
TabEventRow copyWith({String? id, String? payload, DateTime? createdAt}) =>
|
||||
TabEventRow(
|
||||
id: id ?? this.id,
|
||||
payload: payload ?? this.payload,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
);
|
||||
TabEventRow copyWithCompanion(TabEventsCompanion data) {
|
||||
return TabEventRow(
|
||||
id: data.id.present ? data.id.value : this.id,
|
||||
payload: data.payload.present ? data.payload.value : this.payload,
|
||||
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (StringBuffer('TabEventRow(')
|
||||
..write('id: $id, ')
|
||||
..write('payload: $payload, ')
|
||||
..write('createdAt: $createdAt')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(id, payload, createdAt);
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
(other is TabEventRow &&
|
||||
other.id == this.id &&
|
||||
other.payload == this.payload &&
|
||||
other.createdAt == this.createdAt);
|
||||
}
|
||||
|
||||
class TabEventsCompanion extends UpdateCompanion<TabEventRow> {
|
||||
final Value<String> id;
|
||||
final Value<String> payload;
|
||||
final Value<DateTime> createdAt;
|
||||
final Value<int> rowid;
|
||||
const TabEventsCompanion({
|
||||
this.id = const Value.absent(),
|
||||
this.payload = const Value.absent(),
|
||||
this.createdAt = const Value.absent(),
|
||||
this.rowid = const Value.absent(),
|
||||
});
|
||||
TabEventsCompanion.insert({
|
||||
required String id,
|
||||
required String payload,
|
||||
required DateTime createdAt,
|
||||
this.rowid = const Value.absent(),
|
||||
}) : id = Value(id),
|
||||
payload = Value(payload),
|
||||
createdAt = Value(createdAt);
|
||||
static Insertable<TabEventRow> custom({
|
||||
Expression<String>? id,
|
||||
Expression<String>? payload,
|
||||
Expression<DateTime>? createdAt,
|
||||
Expression<int>? rowid,
|
||||
}) {
|
||||
return RawValuesInsertable({
|
||||
if (id != null) 'id': id,
|
||||
if (payload != null) 'payload': payload,
|
||||
if (createdAt != null) 'created_at': createdAt,
|
||||
if (rowid != null) 'rowid': rowid,
|
||||
});
|
||||
}
|
||||
|
||||
TabEventsCompanion copyWith({
|
||||
Value<String>? id,
|
||||
Value<String>? payload,
|
||||
Value<DateTime>? createdAt,
|
||||
Value<int>? rowid,
|
||||
}) {
|
||||
return TabEventsCompanion(
|
||||
id: id ?? this.id,
|
||||
payload: payload ?? this.payload,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
rowid: rowid ?? this.rowid,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, Expression>{};
|
||||
if (id.present) {
|
||||
map['id'] = Variable<String>(id.value);
|
||||
}
|
||||
if (payload.present) {
|
||||
map['payload'] = Variable<String>(payload.value);
|
||||
}
|
||||
if (createdAt.present) {
|
||||
map['created_at'] = Variable<DateTime>(createdAt.value);
|
||||
}
|
||||
if (rowid.present) {
|
||||
map['rowid'] = Variable<int>(rowid.value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (StringBuffer('TabEventsCompanion(')
|
||||
..write('id: $id, ')
|
||||
..write('payload: $payload, ')
|
||||
..write('createdAt: $createdAt, ')
|
||||
..write('rowid: $rowid')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _$AppDatabase extends GeneratedDatabase {
|
||||
_$AppDatabase(QueryExecutor e) : super(e);
|
||||
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
||||
@@ -3815,6 +4079,7 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||
);
|
||||
late final $ProcessedRemoteCommandsTable processedRemoteCommands =
|
||||
$ProcessedRemoteCommandsTable(this);
|
||||
late final $TabEventsTable tabEvents = $TabEventsTable(this);
|
||||
@override
|
||||
Iterable<TableInfo<Table, Object?>> get allTables =>
|
||||
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
||||
@@ -3829,6 +4094,7 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||
appSettingsTable,
|
||||
remoteSyncState,
|
||||
processedRemoteCommands,
|
||||
tabEvents,
|
||||
];
|
||||
@override
|
||||
StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([
|
||||
@@ -6508,6 +6774,168 @@ typedef $$ProcessedRemoteCommandsTableProcessedTableManager =
|
||||
ProcessedRemoteCommandRow,
|
||||
PrefetchHooks Function()
|
||||
>;
|
||||
typedef $$TabEventsTableCreateCompanionBuilder =
|
||||
TabEventsCompanion Function({
|
||||
required String id,
|
||||
required String payload,
|
||||
required DateTime createdAt,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $$TabEventsTableUpdateCompanionBuilder =
|
||||
TabEventsCompanion Function({
|
||||
Value<String> id,
|
||||
Value<String> payload,
|
||||
Value<DateTime> createdAt,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $$TabEventsTableFilterComposer
|
||||
extends Composer<_$AppDatabase, $TabEventsTable> {
|
||||
$$TabEventsTableFilterComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
super.joinBuilder,
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnFilters<String> get id => $composableBuilder(
|
||||
column: $table.id,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
|
||||
ColumnFilters<String> get payload => $composableBuilder(
|
||||
column: $table.payload,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
|
||||
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
||||
column: $table.createdAt,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
}
|
||||
|
||||
class $$TabEventsTableOrderingComposer
|
||||
extends Composer<_$AppDatabase, $TabEventsTable> {
|
||||
$$TabEventsTableOrderingComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
super.joinBuilder,
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnOrderings<String> get id => $composableBuilder(
|
||||
column: $table.id,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
|
||||
ColumnOrderings<String> get payload => $composableBuilder(
|
||||
column: $table.payload,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
|
||||
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
||||
column: $table.createdAt,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
}
|
||||
|
||||
class $$TabEventsTableAnnotationComposer
|
||||
extends Composer<_$AppDatabase, $TabEventsTable> {
|
||||
$$TabEventsTableAnnotationComposer({
|
||||
required super.$db,
|
||||
required super.$table,
|
||||
super.joinBuilder,
|
||||
super.$addJoinBuilderToRootComposer,
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
GeneratedColumn<String> get id =>
|
||||
$composableBuilder(column: $table.id, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<String> get payload =>
|
||||
$composableBuilder(column: $table.payload, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<DateTime> get createdAt =>
|
||||
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
||||
}
|
||||
|
||||
class $$TabEventsTableTableManager
|
||||
extends
|
||||
RootTableManager<
|
||||
_$AppDatabase,
|
||||
$TabEventsTable,
|
||||
TabEventRow,
|
||||
$$TabEventsTableFilterComposer,
|
||||
$$TabEventsTableOrderingComposer,
|
||||
$$TabEventsTableAnnotationComposer,
|
||||
$$TabEventsTableCreateCompanionBuilder,
|
||||
$$TabEventsTableUpdateCompanionBuilder,
|
||||
(
|
||||
TabEventRow,
|
||||
BaseReferences<_$AppDatabase, $TabEventsTable, TabEventRow>,
|
||||
),
|
||||
TabEventRow,
|
||||
PrefetchHooks Function()
|
||||
> {
|
||||
$$TabEventsTableTableManager(_$AppDatabase db, $TabEventsTable table)
|
||||
: super(
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer: () =>
|
||||
$$TabEventsTableFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$$TabEventsTableOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$$TabEventsTableAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> id = const Value.absent(),
|
||||
Value<String> payload = const Value.absent(),
|
||||
Value<DateTime> createdAt = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) => TabEventsCompanion(
|
||||
id: id,
|
||||
payload: payload,
|
||||
createdAt: createdAt,
|
||||
rowid: rowid,
|
||||
),
|
||||
createCompanionCallback:
|
||||
({
|
||||
required String id,
|
||||
required String payload,
|
||||
required DateTime createdAt,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) => TabEventsCompanion.insert(
|
||||
id: id,
|
||||
payload: payload,
|
||||
createdAt: createdAt,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
prefetchHooksCallback: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
typedef $$TabEventsTableProcessedTableManager =
|
||||
ProcessedTableManager<
|
||||
_$AppDatabase,
|
||||
$TabEventsTable,
|
||||
TabEventRow,
|
||||
$$TabEventsTableFilterComposer,
|
||||
$$TabEventsTableOrderingComposer,
|
||||
$$TabEventsTableAnnotationComposer,
|
||||
$$TabEventsTableCreateCompanionBuilder,
|
||||
$$TabEventsTableUpdateCompanionBuilder,
|
||||
(
|
||||
TabEventRow,
|
||||
BaseReferences<_$AppDatabase, $TabEventsTable, TabEventRow>,
|
||||
),
|
||||
TabEventRow,
|
||||
PrefetchHooks Function()
|
||||
>;
|
||||
|
||||
class $AppDatabaseManager {
|
||||
final _$AppDatabase _db;
|
||||
@@ -6533,4 +6961,6 @@ class $AppDatabaseManager {
|
||||
_db,
|
||||
_db.processedRemoteCommands,
|
||||
);
|
||||
$$TabEventsTableTableManager get tabEvents =>
|
||||
$$TabEventsTableTableManager(_db, _db.tabEvents);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user