add support for host override (#335)

This commit is contained in:
Rob Meng
2023-07-18 21:21:39 -04:00
committed by GitHub
parent 5e3167da83
commit a636bb1075
4 changed files with 18 additions and 5 deletions

View File

@@ -37,8 +37,13 @@ export class RemoteConnection implements Connection {
}
this._dbName = opts.uri.slice('db://'.length)
const server = `https://${this._dbName}.${opts.region}.api.lancedb.com`
this._client = new HttpLancedbClient(server, opts.apiKey)
let server: string
if (opts.hostOverride === undefined) {
server = `https://${this._dbName}.${opts.region}.api.lancedb.com`
} else {
server = opts.hostOverride
}
this._client = new HttpLancedbClient(server, opts.apiKey, opts.hostOverride === undefined ? undefined : this._dbName)
}
get uri (): string {