limit

The .limit command sets the maximum number of rows displayed for query results in rsql. This is useful for controlling output size, especially when working with large datasets or when you want to preview data without overwhelming your terminal.

Usage

.limit [rows]

When to use

  • Use .limit 10 to preview a small sample of your data.
  • Use .limit 0 to remove the row limit and display all results (be cautious with large tables).
  • Adjust the limit for exporting, reporting, or interactive exploration.

Examples

Display the current limit setting:

.limit

Set row limit to unlimited (all rows):

.limit 0

Set row limit to 10:

.limit 10

Troubleshooting

  • If you see fewer rows than expected, check the current limit setting.
  • For very large tables, avoid .limit 0 unless you are sure your terminal and system can handle the output.

Demonstration