refactoring
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
extension TableSize on DatabaseConnectionUser {
|
||||
SingleSelectable<double> tableSize(TableInfo table) {
|
||||
return customSelect(
|
||||
'SELECT SUM(pgsize) /(1024.0 * 1024.0)AS pgsize_mb FROM dbstat WHERE name = ?1',
|
||||
variables: [Variable<String>(table.actualTableName)],
|
||||
readsFrom: {table},
|
||||
).map((QueryRow row) => row.read<double>('pgsize_mb'));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:fast_equatable/fast_equatable.dart';
|
||||
|
||||
class EquatableCollection<T> with FastEquatable {
|
||||
final T collection;
|
||||
final bool immutable;
|
||||
|
||||
EquatableCollection(this.collection, {required this.immutable})
|
||||
: assert(
|
||||
collection is Map || collection is Iterable || collection == null,
|
||||
'Collection type not supported',
|
||||
);
|
||||
|
||||
@override
|
||||
bool get cacheHash => immutable;
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [collection, immutable];
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class ReceivedIntentParameter {
|
||||
final String? content;
|
||||
final String? tool;
|
||||
|
||||
ReceivedIntentParameter(this.content, this.tool);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
class ReceivedParameter {
|
||||
final String? content;
|
||||
final String? tool;
|
||||
|
||||
ReceivedParameter(this.content, this.tool);
|
||||
}
|
||||
Reference in New Issue
Block a user