Skip to content

feat: add dedicated row count endpoint #24

@gordonmurray

Description

@gordonmurray

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions