Skip to Main Content
Hands-On Software Architecture with Golang
book

Hands-On Software Architecture with Golang

by Jyotiswarup Raiturkar
December 2018
Intermediate to advanced content levelIntermediate to advanced
500 pages
12h 19m
English
Packt Publishing
Content preview from Hands-On Software Architecture with Golang

Object Relational Mappers (ORMs)

While the application code can certainly interact with the database using SQL statements, you needs to be careful to ensure that the DB interactions are not strewn across the application layers. The Data Access Layer (DAL) is a layer that should be responsible for handling entities and their interactions with the database. The rest of the application is abstracted from the DB interaction details.

Objects Relational Mappers (ORMs) are a special form of DAL, which translate DB entities into objects. Generally this is done seamlessly behind the scenes via generic glue code.

GORM is the most popular Go ORM out there. To install it, we run the following command:

go get "github.com/jinzhu/gorm"

To use GORM, you ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Event-Driven Architecture in Golang

Event-Driven Architecture in Golang

Michael Stack

Publisher Resources

ISBN: 9781788622592Supplemental Content