diff --git a/src/client.ts b/src/client.ts index 992bf6c..232c05f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -177,10 +177,10 @@ export class SQLocal { return data; }; - sql = async >( + sql = async >( queryTemplate: TemplateStringsArray | string, ...params: unknown[] - ): Promise => { + ): Promise => { let statement: Statement; if (typeof queryTemplate === 'string') { @@ -195,25 +195,25 @@ export class SQLocal { 'all' ); const resultRecords = convertRowsToObjects(rows, columns); - return resultRecords as T[]; + return resultRecords as Result[]; }; - transaction = async >( + transaction = async >( passStatements: (sql: typeof sqlTag) => Statement[] - ): Promise => { + ): Promise => { const statements = passStatements(sqlTag); const data = await this.execBatch(statements); return data.map(({ rows, columns }) => { const resultRecords = convertRowsToObjects(rows, columns); - return resultRecords as T[]; + return resultRecords as Result[]; }); }; - batch = async >( + batch = async >( passStatements: (sql: typeof sqlTag) => Statement[] - ): Promise => { - return await this.transaction(passStatements); + ): Promise => { + return await this.transaction(passStatements); }; createCallbackFunction = async (