Skip to content

emulatalk1/simple-bank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Bank

Simple Bank is a Golang learning project. It provides APIs for the frontend to do the following things:

  • Create and mange bank accounts.
  • Record all balance changes to each of the accounts.
  • Performance a money transfer between 2 accounts.

The service is written by Go and aim to learn those topic belows:

  • Gin
  • golang migration
  • gorm, sqlx & sqlc
  • testify
  • How to use GitHub Action to run unit tests automatically.
  • Redis

Database

simple_bank.svg

GORM, sqlx, sqlc

Comparing:

  1. GORM:
    • CRUD functions are already implemented, very short production code (declare the models and using built-in GORM functions).
    • Must learn to write queries using gorm's functions. (How to join tables, declare the association of tables,...).
    • Run slowly on high load.
  2. sqlx:
    • Quite fast and easy to use.
    • Fields mapping via query text and struct tags.
    • Failure won't occur until runtime..
  3. sqlc:
    • Very fast and easy to use.
    • Automatic code generation.
    • Catch SQL query errors before generating codes.

Articles:

About

Learning Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published