Skip to content

simple bank service using golang including full CRUD, migration and unit testing.

Notifications You must be signed in to change notification settings

tr4d3r8/go-backend-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backend-master-golang

This is a boilerplate backend written in Go that uses postgres as a datastore.

Features

  • database connection (postgres)
  • database migration
  • crud code gen
  • crud unit testing

Dependencies

  • Go
  • Docker
  • Taskfile
  • golang-migrate
  • sqlc

Getting started

  • clone the repo
  • get dependencies go mod tidy
  • start run postgres in docker for dev run postgres
  • create database run createdb
  • migrate database run migrate_up
  • run tests run tests

Generate CRUD functions

  • modify query in db/query/
  • run sqlc generate
  • this will create or modify the code gen files in ../sqlc/
    • EXAMPLE:
      • Modifying ../query/account.sql
      • Running sqlc generate
      • Will create/modify ../sqlc/account.sql.go

About

simple bank service using golang including full CRUD, migration and unit testing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published