opensearch-project / opensearch-project/sql-cli

[FEATURE] Support pagination

Open
#14 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
9
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem?
Pagination is not supported

What solution would you like?
Implementing some commands which will manage the paging process. Currently, cli tool interprets every input as a query and sends to OpenSearch. The goal is to add some commands which will be interpreted by the CLI tool.
Example of usage:

opensearchsql> select * from calcs;
fetched rows / total rows = 17/17
...

opensearchsql> set page_size = 10;
opensearchsql> select * from calcs;
Cursor stored as ###
fetched rows / total rows = 10/17
...

opensearchsql> cursor list;
1: created at <timestamp> on page N on query "select ...."
2: created at <timestamp> on page M on query "select ...."

opensearchsql> cursor fetch 1;
Cursor updated as 1
fetched rows / total rows = x/y
...
opensearchsql> cursor fetch 1;
No cursor received, cursor 1 deleted
fetched rows / total rows = z/y
...

What alternatives have you considered?
Return cursor to the user. Not convenient for the end user, because cursor string could be pretty big.

Do you have any additional context?
Probably, I'll do the fix on my own.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI input handling and query-dispatch path, where every input is currently sent to OpenSearch. Define how page-size and cursor commands coexist with SQL queries, then verify the behavior against the examples for storing, listing, fetching, updating, and deleting cursors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.