toJson method

Map<String, Object?> toJson()

Returns an inspection report without parameter values.

Implementation

Map<String, Object?> toJson() => {
  'dialect': dialect.name,
  'sql': sql,
  'parameterCount': parameterCount,
  'columns': [
    for (final c in columns)
      {
        'index': c.index,
        'codecType': c.codecType,
        if (c.table != null) 'table': c.table,
        if (c.column != null) 'column': c.column,
        if (c.presence) 'presence': true,
      },
  ],
  'joins': [
    for (final j in joins)
      {
        'table': j.table,
        'kind': j.left ? 'left' : 'inner',
        'relation': j.relation,
      },
  ],
  'loads': loads.map((l) => l.toJson()).toList(),
  'reads': reads,
  'opaqueReads': opaqueReads,
  'sqlTemplateCount': sqlTemplateCount,
};