Go, SQL, and SQLite

Learn how to use SQL databases in applications by importing the database/SQL package.

We'll cover the following

Overview

Go talks to SQL databases using the package database/sql. This package provides a generic interface to databases that use SQL. It allows you to connect to and interface with different databases by providing the queries and statements to execute.

The database/sql package provides a balance between a low-level and high-level interface. It abstracts data types, connections, and other lower-level aspects of connecting to a database engine, but it still requires you to execute queries through SQL statements. It allows great flexibility for developing applications that rely on databases but requires writing your own functions to process data.

Get hands-on with 1200+ tech skills courses.