Skip to content

Commit

Permalink
fix: support generic fro sql queries
Browse files Browse the repository at this point in the history
  • Loading branch information
octoshikari committed Aug 18, 2023
1 parent c54aa8f commit b8a525a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,11 @@ export class Client {
}
}

async rawSQL(sql: string, params?: unknown[]) {
async rawSQL<T = any>(sql: string, params?: string[]) {
const body = [sql, ...(params?.map((value: any) => value?.toString()) ?? [])]

const response = await this.client.post('$sql', { json: body })
return response.json()
return response.json<T>()
}


Expand Down

0 comments on commit b8a525a

Please sign in to comment.