Currently, getting a row count requires calling /datasets/{name}/rows and reading the total field from the paginated response, which also fetches and serializes actual row data.
A lightweight count endpoint would be useful for health checks, monitoring dashboards, and validation scripts that just need to know how many rows a dataset has.
Proposed implementation:
@app.get("/datasets/{dataset_name}/count")
async def get_dataset_count(dataset_name: str):
validate_dataset_name(dataset_name)
db = get_lance_connection()
table = db.open_table(dataset_name)
return {"dataset": dataset_name, "count": table.count_rows()}
One endpoint, no frontend changes needed.
Currently, getting a row count requires calling
/datasets/{name}/rowsand reading thetotalfield from the paginated response, which also fetches and serializes actual row data.A lightweight count endpoint would be useful for health checks, monitoring dashboards, and validation scripts that just need to know how many rows a dataset has.
Proposed implementation:
One endpoint, no frontend changes needed.