A Package for Working with a Database
Explore how to develop a Go package tailored for interacting with a PostgreSQL database schema. This lesson guides you through downloading necessary packages, creating package files, and writing functions to encapsulate database operations. Understand the benefits of using Go packages for database interaction, such as code sharing, documentation, and abstracting database changes, to build maintainable and collaborative Go applications.
We'll cover the following...
Working with a database schema
This lesson will develop a Go package for working with a given database schema stored on a Postgres database, with the end goal of demonstrating how to develop, store, and use a package. When interacting with specific schemas and tables in our application, we usually create separate packages with all the database-related functions—this also applies to NoSQL databases.