toMap method
Implementation
Map<String, Object?> toMap() => {
'type': type,
'sql': sql,
'statement_payload': preview.payload.toJson(),
'duration_ms': duration.inMicroseconds / 1000,
'success': success,
if (model != null) 'model': model,
if (table != null) 'table': table,
if (parameters.isNotEmpty) 'parameters': parameters,
if (parameterSets.isNotEmpty) 'parameter_sets': parameterSets,
if (rowCount != null) 'row_count': rowCount,
if (error != null) 'error': error.toString(),
};