Skip to content

Commit 988790f

Browse files
committed
fix: update SQLiteCloudClient to use _db
1 parent 23635fb commit 988790f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/refactor/SQLiteCloudClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface SQLiteCloudClientConfig {
1616
export class SQLiteCloudClient {
1717
private connectionString: string
1818
private fetch: Fetch
19+
private _db: Database
1920

2021
constructor(config: SQLiteCloudClientConfig | string) {
2122
let connectionString: string
@@ -31,6 +32,7 @@ export class SQLiteCloudClient {
3132
this.connectionString = connectionString
3233
this.fetch = fetchWithAuth(this.connectionString, customFetch)
3334
this.defaultDb = getDefaultDatabase(this.connectionString) ?? ''
35+
this._db = new Database(this.connectionString)
3436
}
3537

3638
async sql(sql: TemplateStringsArray | string | SQLiteCloudCommand, ...values: any[]) {
@@ -48,7 +50,7 @@ export class SQLiteCloudClient {
4850
}
4951

5052
get db() {
51-
return new Database(this.connectionString)
53+
return this._db
5254
}
5355

5456
get weblite() {

0 commit comments

Comments
 (0)