Skip to content

heitormbonfim/go-product-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to run

From the root directory

go run cmd/main.go

remember to replace in db/conn.go the "go_db" for "localhost" for development

Docker

  1. to build the image
sudo docker build -t go-products-management .
  1. to run the database isolated (for development)
sudo docker compose up -d go_db
  1. to run both images after build
sudo docker compose up -d

Tables Creation

  1. Create product table
CREATE TABLE product (
  id SERIAL PRIMARY KEY,
  product_name VARCHAR(255) NOT NULL,
  price NUMERIC(10, 2)
)
  1. Insert product into product table
INSERT INTO product (
	product_name,
	price
)
VALUES (
	'Weed',
	4.20
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published