add Databse.connect to be able to run in isaltes
This commit is contained in:
parent
26510173de
commit
175cb0fbd2
6
build.yaml
Normal file
6
build.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
targets:
|
||||
$default:
|
||||
builders:
|
||||
moor_generator:
|
||||
options:
|
||||
generate_connect_constructor: true
|
|
@ -15,6 +15,8 @@ part 'database.g.dart';
|
|||
class Database extends _$Database {
|
||||
Database(QueryExecutor e) : super(e);
|
||||
|
||||
Database.connect(DatabaseConnection connection) : super.connect(connection);
|
||||
|
||||
@override
|
||||
int get schemaVersion => 5;
|
||||
|
||||
|
|
|
@ -5361,6 +5361,7 @@ class Files extends Table with TableInfo<Files, DbFile> {
|
|||
|
||||
abstract class _$Database extends GeneratedDatabase {
|
||||
_$Database(QueryExecutor e) : super(SqlTypeSystem.defaultInstance, e);
|
||||
_$Database.connect(DatabaseConnection c) : super.connect(c);
|
||||
Clients _clients;
|
||||
Clients get clients => _clients ??= Clients(this);
|
||||
UserDeviceKeys _userDeviceKeys;
|
||||
|
@ -6196,23 +6197,6 @@ abstract class _$Database extends GeneratedDatabase {
|
|||
}).map(_rowToDbRoomState);
|
||||
}
|
||||
|
||||
Selectable<DbRoomState> dbGetUsers(
|
||||
int client_id, List<String> mxids, String room_id) {
|
||||
var $arrayStartIndex = 2;
|
||||
final expandedmxids = $expandVar($arrayStartIndex, mxids.length);
|
||||
$arrayStartIndex += mxids.length;
|
||||
return customSelect(
|
||||
'SELECT * FROM room_states WHERE client_id = :client_id AND type = \'m.room.member\' AND state_key IN ($expandedmxids) AND room_id = :room_id',
|
||||
variables: [
|
||||
Variable.withInt(client_id),
|
||||
for (var $ in mxids) Variable.withString($),
|
||||
Variable.withString(room_id)
|
||||
],
|
||||
readsFrom: {
|
||||
roomStates
|
||||
}).map(_rowToDbRoomState);
|
||||
}
|
||||
|
||||
DbEvent _rowToDbEvent(QueryRow row) {
|
||||
return DbEvent(
|
||||
clientId: row.readInt('client_id'),
|
||||
|
|
Loading…
Reference in a new issue