execute method
Executes a query on this context.
This method sends a SQL string to the database this instance is connected to. Parameters can be provided in fmtString
, see query for more details.
This method returns the number of rows affected and no additional information. This method uses the least efficient and less secure command for executing queries in the PostgreSQL protocol; query is preferred for queries that will be executed more than once, will contain user input, or return rows.
Implementation
@override
Future<int> execute(String fmtString,
{Map<String, dynamic>? substitutionValues = const {},
int? timeoutInSeconds}) async {
final result = await _execute(
fmtString,
substitutionValues: substitutionValues,
timeoutInSeconds: _connection.queryTimeoutInSeconds,
onlyReturnAffectedRows: true,
);
return result.affectedRowCount;
}