feat: add a filterable count_rows to all the lancedb APIs (#913)

A `count_rows` method that takes a filter was recently added to
`LanceTable`. This PR adds it everywhere else except `RemoteTable` (that
will come soon).
This commit is contained in:
Weston Pace
2024-02-08 09:40:29 -08:00
parent 2c3f982f4f
commit 138fc3f66b
11 changed files with 86 additions and 30 deletions

View File

@@ -372,7 +372,7 @@ export interface Table<T = number[]> {
/**
* Returns the number of rows in this table.
*/
countRows: () => Promise<number>
countRows: (filter?: string) => Promise<number>
/**
* Delete rows from this table.
@@ -840,8 +840,8 @@ export class LocalTable<T = number[]> implements Table<T> {
/**
* Returns the number of rows in this table.
*/
async countRows (): Promise<number> {
return tableCountRows.call(this._tbl)
async countRows (filter?: string): Promise<number> {
return tableCountRows.call(this._tbl, filter)
}
/**