Gorm DB Deep Dive and Techniques to Update Default Values to DB
Pallavi Priya Patharlagadda · Journal of Artificial Intelligence Machine Learning and Data Science · 2023
The application usually stores the data in a Database.So, The Data from object-oriented programming languages must be converted into relational database formats and vice versa using an ORM.GORM is one of the most widely used open-source ORM libraries for Go.Relational databases and the Go programming language are two distinct system types that can have their data flows matched and synchronized.Go contains the struct data type, functions, and interfaces that enable object-oriented programming even if it is not a fully object-oriented language.These capabilities also allow you to design models (struct types that reflect certain database tables) using GORM.GORM enables you to perform operations like updating the table data etc.One of the issues we faced in our project is GORM updates() function doesn't update the default values like false, nil, zero, etc to DB when the data to update is provided as a structure.This paper provides the techniques on how to update the default values when using GORM.