Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wpcodevo/golang-postgresql-api
This article will teach you how to set up a SQLC API project with Golang, standard Database/SQL package, Gin Gonic, PostgreSQL, Golang-migrate, and Docker-compose. You will also learn how to generate Golang database CRUD functions and Structs with the SQLC compiler. The SQLC Golang API will use a PostgreSQL database and run on the Gin Gonic HTTP server. We will use the Golang-migrate package to push the SQL schema to the database.
https://github.com/wpcodevo/golang-postgresql-api
gin go golang jwt postgresql
Last synced: about 17 hours ago
JSON representation
This article will teach you how to set up a SQLC API project with Golang, standard Database/SQL package, Gin Gonic, PostgreSQL, Golang-migrate, and Docker-compose. You will also learn how to generate Golang database CRUD functions and Structs with the SQLC compiler. The SQLC Golang API will use a PostgreSQL database and run on the Gin Gonic HTTP server. We will use the Golang-migrate package to push the SQL schema to the database.
- Host: GitHub
- URL: https://github.com/wpcodevo/golang-postgresql-api
- Owner: wpcodevo
- Created: 2022-06-24T19:11:18.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-02T15:34:53.000Z (about 2 years ago)
- Last Synced: 2024-10-01T10:22:21.412Z (about 1 month ago)
- Topics: gin, go, golang, jwt, postgresql
- Language: Go
- Homepage: https://codevoweb.com/api-golang-postgresql-sqlc-gin-gonic-project-setup
- Size: 49.3 MB
- Stars: 39
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readMe.md
Awesome Lists containing this project
README
# Golang CRUD RESTful API with SQLC and PostgreSQL
![Golang CRUD RESTful API with SQLC and PostgreSQL](https://codevoweb.com/wp-content/uploads/2022/09/Golang-CRUD-RESTful-API-with-SQLC-and-PostgreSQL.webp)
This article will teach you how to build a CRUD RESTful API in Golang that runs on a Gonic Gonic framework and uses a PostgreSQL database. Also, you will learn how to generate the CRUD Functions and Structs with SQLC. We will run the database migration with the Golang migrate library.
## Topics Covered
- Setup and Run PostgreSQL with Docker and Docker-compose
- Setup and Run Database Migration in Golang
- Generate the CRUD Functions and Structs with SQLC
- Load the Environment Variables with Viper
- Create Custom Structs to Validate the Request Body
- Create the Gin Gonic Route Controllers
- Create the Gin Gonic Routes
- Add the Routes to the Middleware Pipeline
- Test the SQLC + Golang CRUD API with PostmanRead the entire article here: [https://codevoweb.com/golang-crud-restful-api-with-sqlc-and-postgresql](https://codevoweb.com/golang-crud-restful-api-with-sqlc-and-postgresql)
Articles in this series:
### 1. How to Setup SQLC CRUD API with Golang and Gin Gonic
[How to Setup SQLC CRUD API with Golang and Gin Gonic](https://codevoweb.com/api-golang-postgresql-sqlc-gin-gonic-project-setup)### 2. Golang, SQLC, and PostgreSQL: JWT Access & Refresh Tokens
[Golang, SQLC, and PostgreSQL: JWT Access & Refresh Tokens](https://codevoweb.com/golang-postgresql-api-access-and-refresh-tokens)### 3. Golang CRUD RESTful API with SQLC and PostgreSQL
[Golang CRUD RESTful API with SQLC and PostgreSQL](https://codevoweb.com/golang-crud-restful-api-with-sqlc-and-postgresql)