From dd0c20bfbeadb09ce17d5506961a0587bddd0ce7 Mon Sep 17 00:00:00 2001 From: Ulises Jeremias Date: Mon, 10 Jun 2024 10:26:18 -0300 Subject: [PATCH] Update README.md --- .../README.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/golang-api-with-postgres-and-sqlc/README.md b/examples/golang-api-with-postgres-and-sqlc/README.md index 804b8bc..a0bfe73 100644 --- a/examples/golang-api-with-postgres-and-sqlc/README.md +++ b/examples/golang-api-with-postgres-and-sqlc/README.md @@ -1,54 +1,54 @@ -# Go API with Docker Compose +# 🚀 Go API with Docker Compose 🌟 -This project containerizes a Go API and a PostgreSQL database using Docker Compose. +This project showcases a powerful and scalable Go API containerized with PostgreSQL using Docker Compose. Perfect for modern developers looking to leverage cutting-edge technology! -## Motivation for Using `sqlc` +## 🎯 Why Use `sqlc`? -Incorporating `sqlc` into a Go project provides numerous advantages: +Integrating `sqlc` into your Go project brings a host of benefits: -- **Strong Type Safety**: Compile-time checks ensure that type errors are caught early in the development process, reducing runtime errors and increasing code reliability. -- **Enhanced Developer Productivity**: By automating the generation of SQL queries and their corresponding Go code, `sqlc` allows developers to concentrate on building application features instead of writing boilerplate database interaction code. -- **Improved Readability and Maintainability**: Using native SQL queries directly in the codebase makes the queries more transparent and easier to understand, debug, and optimize. This approach aligns well with the principles of clean code and maintainability. -- **Optimized Performance**: `sqlc` enables developers to write and fine-tune raw SQL queries, providing greater control over database interactions compared to ORM-based solutions. This can lead to more efficient query execution and better overall performance. +- **🔒 Strong Type Safety**: Catch type errors early in the development process with compile-time checks, reducing runtime errors and boosting code reliability. +- **⚡ Enhanced Developer Productivity**: Automate the generation of SQL queries and corresponding Go code, freeing up time to focus on building amazing features. +- **📖 Improved Readability and Maintainability**: Use native SQL queries directly in your codebase for clearer, easier-to-understand queries that are simple to debug and optimize. +- **🚀 Optimized Performance**: Write and fine-tune raw SQL queries for superior control over database interactions, leading to more efficient query execution and better performance compared to ORM-based solutions. -## Prerequisites +## 🛠 Prerequisites - Docker - Docker Compose - `sqlc` -## Setup +## 📝 Setup Instructions -1. **Clone the Repository**: +1. **🔗 Clone the Repository**: ```bash git clone https://github.com/nanlabs/backend-reference ``` -2. **Navigate to the Project Directory**: +2. **📂 Navigate to the Project Directory**: ```bash cd backend-reference/examples/golang-api-with-postgres-and-sqlc ``` -3. **Generate SQL Queries and Models with `sqlc`**: +3. **⚙️ Generate SQL Queries and Models with `sqlc`**: ```bash sqlc generate ``` -4. **Build and Run the Docker Containers**: +4. **🐳 Build and Run the Docker Containers**: ```bash docker-compose build docker-compose up ``` -The Go API will be accessible at `localhost:8080`. +🎉 Your Go API will be live at `localhost:8080`. -## Stopping the Application +## ⏹ Stopping the Application -To stop the application and remove the containers, networks, and volumes defined in `docker-compose.yml`, run: +To gracefully stop the application and remove all containers, networks, and volumes defined in `docker-compose.yml`, run: ```bash docker-compose down