refactoring

This commit is contained in:
Fabian Freund
2025-02-20 12:27:34 +01:00
parent b81fc1cc42
commit 490e13000b
138 changed files with 1392 additions and 3251 deletions
@@ -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);
}