Skip to content

Commit

Permalink
Merge pull request #4 from Rawnly/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Sep 25, 2022
2 parents c3fd469 + e263ad1 commit 33dcaa1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ class PlanetScaleConnection implements DatabaseConnection {
: compiledQuery.parameters.map((param) => (param instanceof Date ? formatDate(param) : param))

const results = await this.#conn.execute(compiledQuery.sql, parameters)

// If an error is returned throw it.
if (results.error) {
throw results.error
}

return {
rows: results.rows as O[],
numUpdatedOrDeletedRows: results.rowsAffected == null ? undefined : BigInt(results.rowsAffected),
Expand Down

0 comments on commit 33dcaa1

Please sign in to comment.