#Mysql

3 articles

Get to know the Repository Pattern in Golang

Get to know the Repository Pattern in Golang

In the book Domain-Driven Design, Eric Evans explains that

Repository is a mechanism for encapsulating storage, retrieval and search behaviour, which emulates a collection of objects

How To Integrate Golang with MySQL Database

How To Integrate Golang with MySQL Database

Introduction to Package Database

In Golang programming, by default it has a package called database. This package has a set of standard interfaces which provide standards for communication into the database so that we can immediately create the program that we will create using this package to access any type of database with the same code. But what will differ is that only the SQL query code is used according to the database used.

How to Communication Golang with MySQL Database

How to Communication Golang with MySQL Database

Package atau Library

import  "github.com/go-sql-driver/mysql"

Project Initialization

Prepare a new folder with the name mysql-native, then initialize the Golang module to make it more modular. Here’s a quick command.