Skip to content

Commit

Permalink
Fix return type of AsyncDuckDBConnection.prepare
Browse files Browse the repository at this point in the history
This looks like it is supposed to return `AsyncPreparedStatement<T>` but
since the type parameter is not provided it actually returns
`AsyncPreparedStatement<any>`, which passes type checking anyway since
`any` is compatible with `T`.
  • Loading branch information
swlynch99 authored and carlopi committed Nov 26, 2024
1 parent 7d3db7e commit 41c03be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/duckdb-wasm/src/parallel/async_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class AsyncDuckDBConnection {
/** Create a prepared statement */
public async prepare<T extends { [key: string]: arrow.DataType } = any>(
text: string,
): Promise<AsyncPreparedStatement> {
): Promise<AsyncPreparedStatement<T>> {
const stmt = await this._bindings.createPrepared(this._conn, text);
return new AsyncPreparedStatement<T>(this._bindings, this._conn, stmt);
}
Expand Down

0 comments on commit 41c03be

Please sign in to comment.