Skip to content

Commit

Permalink
fix: Support unsafe queries in test tools. (serverpod#2878)
Browse files Browse the repository at this point in the history
  • Loading branch information
hampuslavin authored Oct 18, 2024
1 parent 83a2994 commit bee2cfe
Show file tree
Hide file tree
Showing 113 changed files with 1,358 additions and 1,577 deletions.
24 changes: 11 additions & 13 deletions examples/chat/chat_server/lib/src/generated/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// ignore_for_file: type_literal_in_constant_pattern
// ignore_for_file: use_super_parameters

// ignore_for_file: invalid_use_of_visible_for_testing_member

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod/serverpod.dart' as _i1;

Expand Down Expand Up @@ -207,7 +205,7 @@ class ChannelRepository {
orderDescending: orderDescending,
limit: limit,
offset: offset,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -226,7 +224,7 @@ class ChannelRepository {
orderByList: orderByList?.call(Channel.t),
orderDescending: orderDescending,
offset: offset,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -237,7 +235,7 @@ class ChannelRepository {
}) async {
return session.db.findById<Channel>(
id,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -248,7 +246,7 @@ class ChannelRepository {
}) async {
return session.db.insert<Channel>(
rows,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -259,7 +257,7 @@ class ChannelRepository {
}) async {
return session.db.insertRow<Channel>(
row,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -272,7 +270,7 @@ class ChannelRepository {
return session.db.update<Channel>(
rows,
columns: columns?.call(Channel.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -285,7 +283,7 @@ class ChannelRepository {
return session.db.updateRow<Channel>(
row,
columns: columns?.call(Channel.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -296,7 +294,7 @@ class ChannelRepository {
}) async {
return session.db.delete<Channel>(
rows,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -307,7 +305,7 @@ class ChannelRepository {
}) async {
return session.db.deleteRow<Channel>(
row,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -318,7 +316,7 @@ class ChannelRepository {
}) async {
return session.db.deleteWhere<Channel>(
where: where(Channel.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -331,7 +329,7 @@ class ChannelRepository {
return session.db.count<Channel>(
where: where?.call(Channel.t),
limit: limit,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// ignore_for_file: type_literal_in_constant_pattern
// ignore_for_file: use_super_parameters

// ignore_for_file: invalid_use_of_visible_for_testing_member

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod/serverpod.dart' as _i1;

Expand Down Expand Up @@ -266,7 +264,7 @@ class AuthKeyRepository {
orderDescending: orderDescending,
limit: limit,
offset: offset,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -285,7 +283,7 @@ class AuthKeyRepository {
orderByList: orderByList?.call(AuthKey.t),
orderDescending: orderDescending,
offset: offset,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -296,7 +294,7 @@ class AuthKeyRepository {
}) async {
return session.db.findById<AuthKey>(
id,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -307,7 +305,7 @@ class AuthKeyRepository {
}) async {
return session.db.insert<AuthKey>(
rows,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -318,7 +316,7 @@ class AuthKeyRepository {
}) async {
return session.db.insertRow<AuthKey>(
row,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -331,7 +329,7 @@ class AuthKeyRepository {
return session.db.update<AuthKey>(
rows,
columns: columns?.call(AuthKey.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -344,7 +342,7 @@ class AuthKeyRepository {
return session.db.updateRow<AuthKey>(
row,
columns: columns?.call(AuthKey.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -355,7 +353,7 @@ class AuthKeyRepository {
}) async {
return session.db.delete<AuthKey>(
rows,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -366,7 +364,7 @@ class AuthKeyRepository {
}) async {
return session.db.deleteRow<AuthKey>(
row,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -377,7 +375,7 @@ class AuthKeyRepository {
}) async {
return session.db.deleteWhere<AuthKey>(
where: where(AuthKey.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -390,7 +388,7 @@ class AuthKeyRepository {
return session.db.count<AuthKey>(
where: where?.call(AuthKey.t),
limit: limit,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// ignore_for_file: type_literal_in_constant_pattern
// ignore_for_file: use_super_parameters

// ignore_for_file: invalid_use_of_visible_for_testing_member

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod/serverpod.dart' as _i1;

Expand Down Expand Up @@ -229,7 +227,7 @@ class EmailAuthRepository {
orderDescending: orderDescending,
limit: limit,
offset: offset,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -248,7 +246,7 @@ class EmailAuthRepository {
orderByList: orderByList?.call(EmailAuth.t),
orderDescending: orderDescending,
offset: offset,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -259,7 +257,7 @@ class EmailAuthRepository {
}) async {
return session.db.findById<EmailAuth>(
id,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -270,7 +268,7 @@ class EmailAuthRepository {
}) async {
return session.db.insert<EmailAuth>(
rows,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -281,7 +279,7 @@ class EmailAuthRepository {
}) async {
return session.db.insertRow<EmailAuth>(
row,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -294,7 +292,7 @@ class EmailAuthRepository {
return session.db.update<EmailAuth>(
rows,
columns: columns?.call(EmailAuth.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -307,7 +305,7 @@ class EmailAuthRepository {
return session.db.updateRow<EmailAuth>(
row,
columns: columns?.call(EmailAuth.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -318,7 +316,7 @@ class EmailAuthRepository {
}) async {
return session.db.delete<EmailAuth>(
rows,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -329,7 +327,7 @@ class EmailAuthRepository {
}) async {
return session.db.deleteRow<EmailAuth>(
row,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -340,7 +338,7 @@ class EmailAuthRepository {
}) async {
return session.db.deleteWhere<EmailAuth>(
where: where(EmailAuth.t),
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}

Expand All @@ -353,7 +351,7 @@ class EmailAuthRepository {
return session.db.count<EmailAuth>(
where: where?.call(EmailAuth.t),
limit: limit,
transaction: transaction ?? session.transaction,
transaction: transaction,
);
}
}
Loading

0 comments on commit bee2cfe

Please sign in to comment.