renderSqliteTable function
Renders a paged table plus the continuation note when more rows remain
(omp's renderTable).
Implementation
String renderSqliteTable(
List<String> columns,
List<Map<String, Object?>> rows, {
required int totalCount,
required int offset,
required int limit,
required String table,
}) {
final parts = [buildSqliteAsciiTable(columns, rows)];
final shown = totalCount < offset + rows.length
? totalCount
: offset + rows.length;
if (shown < totalCount) {
final remaining = totalCount - shown;
final nextOffset = offset + rows.length;
parts.add(
truncateSqliteWidth(
_replaceTabs(
'[$remaining more rows; append '
':$table?limit=$limit&offset=$nextOffset to the database path to '
'continue]',
),
maxSqliteRenderWidth,
),
);
}
return parts.join('\n');
}