Skip to content

Commit

Permalink
feat: use sqlx instead of sql (#79)
Browse files Browse the repository at this point in the history
This PR updates the `PostgreSQL` database to use the sqlx driver instead of `sql` to provide more functionalities while maintaining backward compatibility

- [x] Targeted PR against correct branch.
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Wrote unit tests.
- [x] Re-reviewed `Files changed` in the Github PR explorer.
  • Loading branch information
RiccardoM committed Nov 25, 2022
1 parent 81230da commit 4c444c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions database/postgresql/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func (db *Database) GetLastBlockHeight() (int64, error) {
return 0, fmt.Errorf("error while getting last block height, error: %s", err)
}

if height == 0 {
return 0, fmt.Errorf("cannot get block height, no blocks saved")
}

return height, nil
}

Expand Down

0 comments on commit 4c444c9

Please sign in to comment.