Support S3 and GCS from typescript SDK (#106)

This commit is contained in:
Lei Xu
2023-05-30 21:32:17 -07:00
committed by GitHub
parent d3aa8bfbc5
commit 306ada5cb8
10 changed files with 216 additions and 106 deletions

View File

@@ -28,7 +28,8 @@ const { databaseNew, databaseTableNames, databaseOpenTable, tableCreate, tableSe
* @param uri The uri of the database.
*/
export async function connect (uri: string): Promise<Connection> {
return new Connection(uri)
const db = await databaseNew(uri)
return new Connection(db, uri)
}
/**
@@ -38,9 +39,9 @@ export class Connection {
private readonly _uri: string
private readonly _db: any
constructor (uri: string) {
constructor (db: any, uri: string) {
this._uri = uri
this._db = databaseNew(uri)
this._db = db
}
get uri (): string {