Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
As we want to maintain the track of our changes to the DB, we are going to use migrations. In this case, we are going to use dbmate. But, you can use any other tool you want.
Now, we are going to generate the code. For this purpose, we are going to use sqlc.
Now, let's run the tests. For this purpose, we are going to use dockertest, but test containers is also a good solution.
As the code is a bit long, I'm not going to paste it here, but you can find it here.
I have decided to use gRPC because it's a very simple protocol and it's very easy to use.