Skip to content

Commit eed80ea

Browse files
committed
fix(dialect-tauri): cleanup
1 parent 64ed0c2 commit eed80ea

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/dialect-tauri/src/driver.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ export class TaruiSqlDriver<T extends 'sqlite' | 'mysql' | 'postgres'> {
1717
? await this.config.database(`${this.config.type}:${this.config.type === 'sqlite' ? '' : '//'}` as any)
1818
: await this.config.database
1919
this.connection = new TauriSqlConnection(this.db)
20-
if (this.config.onCreateConnection) {
21-
await this.config.onCreateConnection(this.connection)
22-
}
20+
21+
await this.config.onCreateConnection?.(this.connection)
2322
}
2423

2524
async acquireConnection(): Promise<DatabaseConnection> {

packages/dialect-tauri/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ export class TauriSqlDialect<T extends 'sqlite' | 'mysql' | 'postgres'> {
4343
* support MySQL, PostgreSQL and SQLite
4444
*/
4545
constructor(config: TauriSqlDialectConfig<T>) {
46-
this.#config = {
47-
...config,
48-
type: config.type ?? 'sqlite',
49-
}
46+
this.#config = config
5047
}
5148

5249
createDriver(): Driver {

0 commit comments

Comments
 (0)