CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
date: Wed, 16 Jul 2025 02:41:31 GMT
content-type: text/html; charset=utf-8
last-modified: Tue, 15 Dec 2020 17:31:43 GMT
vary: Accept-Encoding
access-control-allow-origin: *
etag: W/"5fd8f2ff-ec3"
expires: Wed, 16 Jul 2025 02:51:31 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: DBD4:39A937:76A41D:8119BE:6877115B
Go database/sql tutorial
- Go database/sql tutorial
- Overview
- Importing a Database Driver
- Accessing the Database
- Retrieving Result Sets
- Modifying Data and Using Transactions
- Using Prepared Statements
- Handling Errors
- Working with NULLs
- Working with Unknown Columns
- The Connection Pool
- Surprises, Antipatterns and Limitations
- Related Reading and Resources
Go database/sql tutorial
Improve this pageThe idiomatic way to use a SQL, or SQL-like, database in Go is through the database/sql package. It provides a lightweight interface to a row-oriented database. This website is a reference for the most common aspects of how to use it.
Why is this needed? The package’s documentation tells you what everything does, but it doesn’t tell you how to use the package. Many of us find ourselves wishing for a quick-reference and a “getting started” orientation that tells stories instead of listing facts. Contributions are welcome; please send pull requests here.