simonw / simonw/datasette

Stream all results for arbitrary SQL and canned queries

Open
#526 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

csv feature small
Dominant language
Python
Stars
11.5k
Forks
904
Avg merge
4d 17h
Merged PRs (30d)
18

Description

I think that there is a difficulty with canned queries.

When I want to stream all results of a canned query TwoDays I get only first 1.000 records.

Example:
http://myserver/history_sample/two_days.csv?_stream=on

returns only first 1.000 records.

If I do the same with the whole database i.e.
http://myserver/history_sample/database.csv?_stream=on

I get correctly all records.

Any ideas?

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 by reproducing the two CSV URLs in the issue: the canned query at /history_sample/two_days.csv?_stream=on and the database export at /history_sample/database.csv?_stream=on. Compare their streaming paths and identify why the canned query stops at 1,000 records. Done means streaming the canned query returns all records, consistently with the database export.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql, sqlite
Domain
api, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.