sql

command
v0.0.0-...-d51f5ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 4 Imported by: 0

README

How to Access Relational Databases with Go?

Using PostgreSQL as an example.

Packages Used

  • sql: Generic SQL interface provided by the Go standard library. Must be used in conjunction with a database driver.
  • pq: Pure Go PostgreSQL driver for database/sql.

Prerequisite

  • Install Docker.

Quick Start

  • Start a Postgres docker instance with docker-compose.
cd sql
docker compose up -d
  • Execute the program.
go run main.go
  • Tear down the Postgres docker instance.
docker compose down

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL