mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-20 13:30:41 +00:00
fix(node) Unit tests hangs and don't exit (#396)
This commit is contained in:
@@ -23,7 +23,7 @@ import { Query } from './query'
|
||||
import { isEmbeddingFunction } from './embedding/embedding_function'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const { databaseNew, databaseTableNames, databaseOpenTable, databaseDropTable, tableCreate, tableAdd, tableCreateVectorIndex, tableCountRows, tableDelete } = require('../native.js')
|
||||
const { databaseNew, databaseTableNames, databaseOpenTable, databaseDropTable, tableCreate, tableAdd, tableCreateVectorIndex, tableCountRows, tableDelete, tableClose } = require('../native.js')
|
||||
|
||||
export { Query }
|
||||
export type { EmbeddingFunction }
|
||||
@@ -215,6 +215,12 @@ export interface Table<T = number[]> {
|
||||
* ```
|
||||
*/
|
||||
delete: (filter: string) => Promise<void>
|
||||
|
||||
/**
|
||||
* Immediately closes the connection to this Table. After close is called,
|
||||
* all operations on this Table will fail.
|
||||
*/
|
||||
close: () => Promise<void>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -402,6 +408,14 @@ export class LocalTable<T = number[]> implements Table<T> {
|
||||
async delete (filter: string): Promise<void> {
|
||||
return tableDelete.call(this._tbl, filter)
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately closes the connection to this Table. After close is called,
|
||||
* all operations on this Table will fail.
|
||||
*/
|
||||
async close (): Promise<void> {
|
||||
return tableClose.call(this._tbl)
|
||||
}
|
||||
}
|
||||
|
||||
/// Config to build IVF_PQ index.
|
||||
|
||||
@@ -165,4 +165,8 @@ export class RemoteTable<T = number[]> implements Table<T> {
|
||||
async delete (filter: string): Promise<void> {
|
||||
throw new Error('Not implemented')
|
||||
}
|
||||
|
||||
async close (): Promise<void> {
|
||||
throw new Error('Not implemented')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user