pretend method
Runs action with pretend mode enabled and returns the captured SQL.
No actual database operations are performed; this is useful for debugging and previewing generated queries.
final statements = await ds.pretend(() async {
await ds.repo<User>().insert(user);
});
for (final entry in statements) {
print('SQL: ${entry.sql}');
}
Implementation
Future<List<QueryLogEntry>> pretend(FutureOr<void> Function() action) {
_ensureInitialized();
return _connection!.pretend(action);
}