Skip to main content
Version: 2.8.x(Latest)

Database operations are often the most complex part of business projects. The GoFrame database components actually provide very powerful and flexible ways to operate. Here, we provide some best practice examples for everyone to reference and learn from.

📄️ Try to use JSON for complex types for storage, facilitating automatic conversion to objects upon scanning, avoiding custom parsing

The advantages of storing complex type data using JSON format in database design, primarily achieving automatic conversion through the GoFrame framework, thereby simplifying code. Taking product sale specifications as an example, the creation, deletion, updating, and querying of the database is realized by defining and using Go structs, avoiding the complexity of custom parsing. Additionally, it details how to write and query data in a Go application, ensuring an efficient data handling process.