The remote catalog could only drop an empty database: it always asked
the server for a restricted drop.
`DropDatabaseRequest::cascade`, `drop_database(..., cascade=True)` in
Python and `dropDatabase(name, { cascade: true })` in TypeScript ask the
server to drop everything in the database first. The name stays taken
until the server finishes cleaning up the dropped objects' storage. A
restricted drop remains the default.
1.9 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb / Catalog
Class: Catalog
A remote catalog manages databases through the server's root namespace.
Accessors
uri
get uri(): string
The root namespace endpoint.
Returns
string
Methods
connectDatabase()
connectDatabase(name): Promise<Connection>
Connect to an existing database by its logical name.
Parameters
- name:
string
Returns
Promise<Connection>
createDatabase()
createDatabase(name, options): Promise<Connection>
Create a database, or open an existing database when existOk is true.
Parameters
-
name:
string -
options =
{} -
options.existOk?:
boolean
Returns
Promise<Connection>
dropDatabase()
dropDatabase(name, options): Promise<void>
Drop a database. A nonempty database is an error unless cascade is set,
which drops everything in it first; the name stays taken until the server
finishes cleaning up their storage.
Parameters
-
name:
string -
options =
{} -
options.cascade?:
boolean -
options.ignoreMissing?:
boolean
Returns
Promise<void>
listDatabases()
listDatabases(options): DatabaseNames
Iterate lazily over all database names using for await...of.
pageToken resumes from a saved token; omitted starts at the beginning.
pageLimit limits each REST response, not the total; omitted uses the server default.
Request errors are raised during iteration and terminate the iterator.
Parameters
-
options =
{} -
options.pageLimit?:
number -
options.pageToken?:
string
Returns
Example
for await (const name of catalog.listDatabases({ pageLimit: 20 })) {
console.log(name);
}