-
Book Overview & Buying
-
Table Of Contents
Practical Systems Programming in Go
By :
SQLite3 is one of the most convenient databases for Go developers: it is lightweight and serverless and stores data in a single file, making it ideal for prototyping, local testing, and embedded applications. In this section, you will learn how to connect to a SQLite3 database from Go, create tables, and insert and query data. We will also cover how to use prepared statements for efficient repeated queries and how to combine SQLite3 with the database/sql package for a clean design.
When working with external packages such as those used for SQLite3 or PostgreSQL, it is a good practice to organize your Go code into separate directories for clarity and maintainability. Each directory can represent a small, self-contained module or program, making it easier to manage dependencies and avoid conflicts between projects. Before running your code, you should initialize the Go project in that directory by executing go mod init, which creates a...