$executeRaw method
Execute raw SQL.
Example:
final int affectedRows = await prisma.$executeRaw('DELETE FROM User');
Implementation
Future<int> $executeRaw(
String query, {
List<dynamic> parameters = const [],
}) async {
final String sdl = GraphQLField(
'mutation',
fields: GraphQLFields([
GraphQLField(
'queryRaw',
args: GraphQLArgs([
GraphQLArg('query', query),
GraphQLArg('parameters', serializeRawParameters),
]),
)
]),
).toSdl();
// Request the query.
final QueryEngineResult result = await $engine.request(
query: sdl,
headers: $headers,
);
// return the affected rows.
return result.data['executeRaw'];
}